Question : Directory.CreateDirectory

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?

Answer : Directory.CreateDirectory

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

1:
2:
Dim dirSecurity As System.Security.AccessControl.DirectorySecurity = System.IO.Directory.GetAccessControl("c:\test")
System.IO.Directory.CreateDirectory("c:\test2", dirSecurity)
Random Solutions  
 
programming4us programming4us