check permissions in a local folder with with visual basic

I would like to know how to check the permissions or rights in a local folder with visual basic.

for example

I had "c:\test", I would like to know what rights or permissions as this folder

altariamx2003Asked:
Who is Participating?
 
Luis PérezConnect With a Mentor Software Architect in .NetCommented:
Imports System.IO
Imports System.Security.AccessControl
...

Dim folder As DirectoryInfo = New DirectoryInfo("c:\test")
Dim security As DirectorySecurity = folder.GetAccessControl()

'In this object, "security", you have a lot of information about access rules, audit rules, and so on about the folder.

'Check the MSDN documentation for the DirectorySecurity class and how to deal with it:
http://msdn.microsoft.com/en-us/library/system.security.accesscontrol.directorysecurity.aspx

Hope that helps.
0
All Courses

From novice to tech pro — start learning today.