C:\Documents and Settings' is denied

  • Thread starter Thread starter Blader
  • Start date Start date
B

Blader

Guest
Hello.

I used the code below. If i it run "C:\Documents and Settings' is denied" appears. How can I skip denied folders?

Thank You.

string rootDirectory = System.IO.DriveInfo.GetDrives()[0].RootDirectory.FullName;
string[] files = System.IO.Directory.GetFiles(rootDirectory,
"file.exe", System.IO.SearchOption.AllDirectories);

foreach (var str in files)
{
Console.WriteLine(files);
}

Continue reading...
 
Back
Top