System volume information-access denied C#

January 2017



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


Published by aakai1056. Latest update on March 21, 2012 at 12:12 PM by aakai1056.
This document, titled "System volume information-access denied C#," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).