A FileSecurity security = new FileSecurity("mydata.xml", AccessControlSections.All); security.SetAccessRuleProtection(true, true);
File.SetAccessControl("mydata.xml", security);
B FileSecurity security = new FileSecurity();
security.SetAccessRuleProtection(true, true);
File.SetAccessControl("mydata.xml", security);
C FileSecurity security = File.GetAccessControl("mydata.xml"); security.SetAccessRuleProtection(true, true);
D FileSecurity security = File.GetAccessControl("mydata.xml"); security.SetAuditRuleProtection(true, true); File.SetAccessControl("mydata.xml", security);