Not getting all files due to special directory...

Sep 14 2010 2:49 AM

Hello friends,

foreach (FileInfo fi in new DirectoryInfo(filePath).GetFiles("*.*", SearchOption.AllDirectories))
{

}

I am using above code to get all files in selected path, if i select E:\ then "System Volume Information" folder will not be accessible and foreach will throw exception and its come out of loop. not getting other folder/files.

please suggest how can we get all files/folder except special folder???

Thanks and Regards,

Abhijit



Answers (2)