Solved

Directory.CreateDirectory

Posted on 2010-08-19
1
460 Views
Last Modified: 2012-08-14
Using the above method of Directory.CreateDirectory(Path, Security). How can I retrieve the security from one directory and place it or copy it another?
0
Comment
Question by:thenrich
1 Comment
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 500 total points
ID: 33477488
You can use GetAccessControl to return DirectorySecurity about one directory and then use that in your call to CreateDirectory.
The example below obtains the security from the folder C:\Test then creates a new directory with the same security named C:\Test2

Dim dirSecurity As System.Security.AccessControl.DirectorySecurity = System.IO.Directory.GetAccessControl("c:\test")

System.IO.Directory.CreateDirectory("c:\test2", dirSecurity)

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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