Get files from directory (including all subdirectories)
If you want to search also in subfolders use parameter SearchOption.AllDirectories.
string[] filePaths = Directory.GetFiles(@"c:\test\", "*.bmp",
SearchOption.AllDirectories);
returns:
"c:\test\test.BMP"
"c:\test\test2\test2.BMP"
for Folder:
string[] folders = System.IO.Directory.GetDirectories(@"C:\test\","*", System.IO.SearchOption.AllDirectories);
No comments:
Post a Comment