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
Any ideas on what i could be doing wrong ?


Back to top
MultiQuote