Get List of Files in a Directory

session101

Member
Joined
May 10, 2006
Messages
23
I want to get all the pdf files in all folders under a directory, C:\Temp

How would I do this? This is an ASP.NET app with a C# backend. TIA.
 
System.IO.Directory.GetFiles("c:\temp", "*.pdf")

should do the trick, although permissions may need to be adjusted to allow the web application access to the folder itself.
 
If youre using VB2005 you can use :

[VB]My.Computer.FileSystem.GetDirectories("C:\\Temp",FileIO.SearchOption.SearchAllSubDirectories, "*.pdf")[/VB]
 

Similar threads

A
Replies
0
Views
78
Ashkan Satarpour
A
E
Replies
0
Views
76
E
J
Replies
0
Views
59
Jalil Sear [MCPD SharePoint]
J
Back
Top