GeekSmack Community: [c#] Stopping files being deleted - GeekSmack Community

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[c#] Stopping files being deleted

#1 User is offline   AlphaAddict 

  • I ♥ WareZ
  • PipPipPip
  • Group: Member
  • Posts: 461
  • Joined: 06-November 08
  • Gender:Male
  • Location:Ireland

Posted 20 March 2010 - 10:24 PM

FileSecurity ACL = File.GetAccessControl(InputFile);
                    ACL.AddAccessRule(new FileSystemAccessRule("Guest", FileSystemRights.Delete, AccessControlType.Deny));
                    ACL.AddAccessRule(new FileSystemAccessRule("SYSTEM", FileSystemRights.Delete, AccessControlType.Deny));
                    ACL.AddAccessRule(new FileSystemAccessRule("Administrators", FileSystemRights.Delete, AccessControlType.Deny));
                    ACL.AddAccessRule(new FileSystemAccessRule("Users", FileSystemRights.Delete, AccessControlType.Deny));
                    File.SetAccessControl(InputFile, ACL);


Im trying to secure films on my raid using the above, and the readonly property but nothing seems to stop me from deleting the files :fp:

Any ideas on what i could be doing wrong ?
Posted Image
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users


This page is sponsored by TopHostingCenter.com, a web hosting provider that specializes in cloud hosting.

As well as Hosted Exchange