List of Files from URL Directory using VB

  • Thread starter Thread starter Eliyahu Goldin
  • Start date Start date
E

Eliyahu Goldin

First you need to map the virtual path to the physical one. Do this with the
page's MapPath method.

Second, have a look into System.IO namespace. You will find plenty of
classes to operate on directories and files.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
I am looking to get a list of files for a URL reference such as
http://localhost/manager/ for a certain search pattern say "*.xls". How do I
go about this using VB and what class libraries are best to use. If anyone
has any code or can redirect me to a better site then that would be great.
Thanks in advance.
 
I am looking to get a list of files for a URL reference such as
http://localhost/manager/ for a certain search pattern say "*.xls". How do I
go about this using VB and what class libraries are best to use. If anyone
has any code or can redirect me to a better site then that would be great.
Thanks in advance.

System.IO is your friend.

Once you have imported it you can do this:


'Get the physical path of the root
Dim folder As String = Page.MapPath("~")
'Get a string array of all excel files
Dim dirs As String() = Directory.GetFiles(folder, "*.xls")
 
Thanks all. I will try.

Rad said:
System.IO is your friend.

Once you have imported it you can do this:


'Get the physical path of the root
Dim folder As String = Page.MapPath("~")
'Get a string array of all excel files
Dim dirs As String() = Directory.GetFiles(folder, "*.xls")
 
Back
Top