In C #, there are methods for getting a list of files to which you can apply the SearchOption.AllDirectories parameter to the input.
Tell me, is it possible to somehow avoid any exceptions (Ignore)?
For example, the program will try to look into the system folder where access is absent.
UPD
My question is not quite double.
The question for which the link is provided describes how to ignore some folders during a recursive traversal.
My question is, is it possible to use SearchOption.AllDirectories and the root of the C drive to ignore all exceptions and return a list of files.
try { ... } catch { ... }? - Mirdin