Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Files in a Directory...

Status
Not open for further replies.

bartee

MIS
Mar 20, 2005
147
US
I am releatively new to ASP.Net and am trying to develop a web page that lists all the files in a specific directory. I need to pull both the filename and extension. At some point in the future -- maybe the file size -- but that is not important right now.

I am developing in VB in creating this webpage.

Can anyone make a suggestions to help me accomplish this. Sample code would be very helpful. Ideally, I would list the filenames in a list box or datagrid so the user can select, sort, etc.

Thanks very much in advance.
 
This will get you the files in a directory

FileSystemInfo fsiDirs = (FileSystemInfo[]) di.GetSubdirectories();
FileSystemInfo fsiAspx = (FileSystemInfo[]) di.GetFiles(".aspx");

This is in C#
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top