List of Files from URL Directory using VB

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
 
M

MS

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.
 
R

Rad [Visual C# MVP]

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")
 
M

MS

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,304
Latest member
CalmwellCBDIngredients

Latest Threads

Top