Windows Develop Bookmark and Share   
 index > Windows Forms General > Recursive file Search
 

Recursive file Search

hello;

I was looking for search dir for files code and here is a sample code written by some on the net which I came across, and now i dont know to use it

link http://codesnip.net/recursive-file-list-builder-csharp

how to use the class to add it found items to a textbox

FileListFL=new FileList{SearchPath= "D:\\Somepath" ,SearchPattern= "*.exe" ,SearchLevel=2};



Power-Mosfet  Monday, September 14, 2009 5:27 PM
Check this out :
this link has the code to get all the files in a List depending on permissions.
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/ca88a606-a621-4273-a1e9-bc9828790017


for permissions u can see this.
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/ebd190dc-5c74-4d3a-bba9-ad6e1d26a7a2

hope this helps.
Lemme know if this helps.
Paras
paras kumar  Monday, September 14, 2009 8:04 PM

If you are looking to search recursively for file then you can use following code

string[] str = System.IO.Directory.GetFiles("Path of directory", "*.exe", System.IO.SearchOption.AllDirectories);
for (int i = 0; i <= str.Length; i++)
{
      MessageBox.Show(str[i]);
}

Gaurav Khanna
Khanna Gaurav  Monday, September 14, 2009 6:04 PM
hi,

this code has no access to some folders

Power-Mosfet  Monday, September 14, 2009 7:05 PM
Check this out :
this link has the code to get all the files in a List depending on permissions.
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/ca88a606-a621-4273-a1e9-bc9828790017


for permissions u can see this.
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/ebd190dc-5c74-4d3a-bba9-ad6e1d26a7a2

hope this helps.
Lemme know if this helps.
Paras
paras kumar  Monday, September 14, 2009 8:04 PM

You can use google to search for other answers

Custom Search

More Threads

• Password change logic.
• datagridview only refreshing if datagridview clicked
• Appending RichTextBox Data
• custom persistance mechanism for settings
• Culture specific .dll's
• How to disable the Right-Click popup on a VScrollBar?
• whidbey: creating a fading form, similar to the MsOutlook "mail received" form
• Microsoft Visual Studio 2008 Windows Mobile ( Final Project )
• AssemblyDescription attribute retrieve
• satelitte dll loading