session101 Posted May 10, 2006 Posted May 10, 2006 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. Quote
Administrators PlausiblyDamp Posted May 11, 2006 Administrators Posted May 11, 2006 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
session101 Posted May 11, 2006 Author Posted May 11, 2006 How would I get all the pdf files in all subdirectories of the parent, Temp directory? Thanks! Quote
Administrators PlausiblyDamp Posted May 11, 2006 Administrators Posted May 11, 2006 You would need to recurse through the sub folders, search these forums and you'll find some examples of how to do it. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
nbrege Posted May 11, 2006 Posted May 11, 2006 If you're using VB2005 you can use : My.Computer.FileSystem.GetDirectories("C:\\Temp",FileIO.SearchOption.SearchAllSubDirectories, "*.pdf") Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.