How to recursively search directories
-
Hi, I am new to C# .Net and have a question. I am tryng to recursively search directories. I have found a bunch of examples. Most are done using a console application. I want to accomplish this task via the web (Web Application). Does anyone have example on how to loop recursively through directories on your hard drive and return the info to an aspx page? I will be looking for zip files and will want to put the file info into an array so I can loop through & return the information. Thanks.
-
Hi, I am new to C# .Net and have a question. I am tryng to recursively search directories. I have found a bunch of examples. Most are done using a console application. I want to accomplish this task via the web (Web Application). Does anyone have example on how to loop recursively through directories on your hard drive and return the info to an aspx page? I will be looking for zip files and will want to put the file info into an array so I can loop through & return the information. Thanks.
-
Hi, I am new to C# .Net and have a question. I am tryng to recursively search directories. I have found a bunch of examples. Most are done using a console application. I want to accomplish this task via the web (Web Application). Does anyone have example on how to loop recursively through directories on your hard drive and return the info to an aspx page? I will be looking for zip files and will want to put the file info into an array so I can loop through & return the information. Thanks.
-
string []files = System.IO.Directory.GetFiles(@"C:\SomeDir", "*.zip", System.IO.SearchOption.AllDirectories);
Thank you for your response. I forgot to specify we have not upgraded to the 2.0 framework. System.IO.SearchOption opt = System.IO.SearchOption.AllDirectories; does not work. My first attempt(b4 the post) was DirectoryInfo di = new DirectoryInfo(@"C:\Temp"); foreach(DirectoryInfo file in di.GetDirectories()) { Response.Write("Looking at file \""+file.FullName+"\""+"
"); } But it this does not go into subdirectiories. Help. Also, would you bind the result set to a data grid? What are the best option for displaying the result set to the web? Thanks in advance.