I am working on a project called computer scanner
, But when I run my code in order to scan my hard drives its gives me an exception "Access Denied to System Volume Information Folders
" and there are some other folders too which has the same behavior I cannot access them.
After studying about this Exception from Internet I have got to learn that after adding "Manifest File" and changing it option to "Require Administrator" to the program will run as a ADMINISTRATOR but unfortunately nothing as such happened. I am using some code which would allow me to run my code as a Administrator, but still showing me the same exception.
WindowsIdentity CurrentIdentity = WindowsIdentity.GetCurrent();
WindowsPrincipal CurrentPrincipal = new WindowsPrincipal(CurrentIdentity);
if (CurrentPrincipal.IsInRole(WindowsBuiltInRole.Administrator))
{
//Scanning Code will Execute
}