System.Security.AccessControl.FileSystemSecurity.SetAuditRule Method

Sets the specified audit rule for the current file or directory.

Syntax

public void SetAuditRule (FileSystemAuditRule rule)

Parameters

rule
A System.Security.AccessControl.FileSystemAuditRule object that represents an audit rule to set for a file or directory.

Remarks

The FileSystemSecurity.SetAuditRule(FileSystemAuditRule) method adds the specified audit rule or overwrites any identical audit rules that match the System.Security.AccessControl.FileSystemRights value of the rule parameter. For example, if the rule parameter specifies a FileSystemRights.Read value and the FileSystemSecurity.SetAuditRule(FileSystemAuditRule) method finds an identical audit rule that specifies the FileSystemRights.Read value, the identical rule will be overwritten. If the FileSystemSecurity.SetAuditRule(FileSystemAuditRule) method finds an identical audit rule that specifies the FileSystemRights.Write value, the identical rule will not be overwritten.

Requirements

Namespace: System.Security.AccessControl
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0