UnauthorizedAccessException cannot resolve Directory.GetFiles failure
- by Ric Coles
Hi all,
Directory.GetFiles method fails on the first encounter with a folder it has no access rights to.
The method throws an UnauthorizedAccessException (which can be caught) but by the time this is done, the method has already failed/terminated.
The code I am using is listed below:
try
{
// looks in stated…