// Process the list of files found in all directory.
string[]
fileEntries = Directory.GetFiles(sourceDir,
"*", SearchOption.AllDirectories);
foreach
(string fileName in
fileEntries)
{
// do something with fileName
Console.WriteLine(fileName);
}
If you change the "*" to ex. "*.log" you will get all filenames that ends with ".log".
No comments:
Post a Comment