Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

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

0
altariamx2003
Asked:
altariamx2003
1 Solution
 
Luis PérezSoftware 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now