System volume information-access denied C#

December 2016



Issue


I'm trying to make a program to list all the subdirectories of a root directory. I've used C:

The access to the folder "System Volume Information 'is denied.
How to ignore this exception?

Solution


try 
{ 
//code allowing file browsing
} 
catch(UnauthorizedAccessException) 
{ 
//ignore exception 
}

Related :

This document entitled « System volume information-access denied C# » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.