Lada_Karford Posted February 24, 2010 Posted February 24, 2010 Dim DirInfo As IO.DirectoryInfo = DriveInfo.RootDirectory If I get into a protected system folder like "System Volume Information" in the root of drive, I get System.UnauthorizedAccessException. So how can I check DirInfo to prevent this exception? Thanks. Quote
Administrators PlausiblyDamp Posted February 24, 2010 Administrators Posted February 24, 2010 Most of the system protected folders are marked as both hidden and system - it might be worth checking these attributes before attempting to access the folder. Alternatively you could just wrap the access in a try...catch block and handle the UnauthorizedAccessException when it occurs. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Leaders snarfblam Posted February 24, 2010 Leaders Posted February 24, 2010 See also: Xtreme VB Talk Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.