Reputation:
In my Asp.net and C# web application ,i want to search for a file with file name or a wildcard in the hard drive (say C:\ for example) and display the results in a tree view.How can we achieve this ?
Upvotes: 0
Views: 3219
Reputation: 1977
Try this:
DirectoryInfo folder = new DirectoryInfo(@"C:\Examples");
FileInfo[] files = folder.GetFiles("MyFile*.txt", SearchOption.AllDirectories);
Upvotes: 1