Solved

check permissions in a local folder with with visual basic

Posted on 2011-09-28
1
189 Views
Last Modified: 2012-06-21
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
Comment
Question by:altariamx2003
1 Comment
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 500 total points
ID: 36813066
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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now