Check Security Privileges on Folder Before Adding to TreeView

Jun 23 2010 4:27 PM
Greetings,

I have an Explorer style Form (vb.net) with a TreeView and ListView.  All network drives are added as nodes to the TreeView with their folders as child nodes.  However, when the application comes across a folder to which is does not have access privileges, an error is thrown.  The user get a Windows prompt to "Continue" or "Quit".  Clicking continue stops the sub that adds the nodes to the TreeView.  For example, if there are 10 folders but the fifth folder cannot be accessed, then only the first five folders are added to the TreeView and the fifth one will not have any children because the folder can't be opened.

Does anyone know a way that I can check the security privileges for a folder, without opening the folder, so that I can skip over any folders that my application cannot access, thereby avoiding the error?

Please note: changing access privileges to allow my application to access all the folders is not an option.

Thanks!

Answers (3)