View Single Post
Old Jul 11th, 2007, 11:31 PM   #1
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
Directory Security

So Right now I'm working on Directory Security permissions. I have the following code:
vbnet Syntax (Toggle Plain Text)
  1.  
  2. MsgBox("hi")
  3. Dim myacc As New DirectorySecurity
  4. myacc.AddAccessRule(New FileSystemAccessRule("MyUser", FileSystemRights.FullControl, AccessControlType.Allow))
  5. IO.Directory.CreateDirectory("Test",myacc)
Which creates a directory "Test" and then tries to set a new access control to it. The problem is the Directory Security settings has inherit on automatically, How do I turn that off? And by turning that off will it automatically allow me to do what I need it to do, being remove all the users and setting "MyUser" to be the only one with access to it? I also need to set the owner of the directory. I've just been working on it for about an hour and at the point of "giving" up until another time. UGH
PhilBon is offline   Reply With Quote