Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FileSystemSecurity::AddAuditRule Method (FileSystemAuditRule^)

 

Adds the specified audit rule to the current file or directory.

Namespace:   System.Security.AccessControl
Assembly:  mscorlib (in mscorlib.dll)

public:
void AddAuditRule(
	FileSystemAuditRule^ rule
)

Parameters

rule
Type: System.Security.AccessControl::FileSystemAuditRule^

A FileSystemAuditRule object that represents an audit rule to add to a file or directory.

Exception Condition
ArgumentNullException

The rule parameter is null.

The AddAuditRule method adds a new audit rule to the list of rules contained within a FileSystemSecurity object.

If an audit rule already exists for the specified rule, the AddAuditRule method will still add the rule.

The following code example uses the AddAuditRule method to add an audit rule to a file and uses the RemoveAuditRule method to remove the audit rule from the file. You must supply a valid user or group account to run this example.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft