Answer the question
In order to leave comments, you need to log in
How to make a directory search so that it bypasses the system ones?
string[] filesForWork = Directory.GetFileSystemEntries(SelectFolder, file_name.Text, SearchOption.AllDirectories);
Answer the question
In order to leave comments, you need to log in
The easiest option is to make your own method instead of SearchOption.AllDirectories, bypass all directories with recursion and bypass exceptions with try-catch.
Here Solution 3: www.codeproject.com/Questions/173054/Ignore-Unauth...
Here is a whole thread with such solutions: stackoverflow.com/questions/172544/ignore-folders-...
Elevate privileges to administrative. Although in this case, you should correctly handle the lack of access to the folder. This is a normal situation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question