Posted on Wednesday, May 12, 2010 12:32 PM
//collect directory names and put them in an array
string[] mapnaam = System.IO.Directory.GetDirectories(@"C:\");
//loop through the array
foreach (string map in mapnaam)
{
//for each file found in the directory with the extension 'txt'
foreach (string filename in System.IO.Directory.GetFiles(map, "*.txt", System.IO.SearchOption.TopDirectoryOnly))
{
do something...
}
}