SemaphoreSecurity.SetAuditRule(SemaphoreAuditRule) 方法

定义

不论 AuditFlags 的值如何,移除与指定的规则具有相同用户的所有审核规则,然后添加指定的规则。Removes all audit rules with the same user as the specified rule, regardless of the AuditFlags value, and then adds the specified rule.

public:
 void SetAuditRule(System::Security::AccessControl::SemaphoreAuditRule ^ rule);
public void SetAuditRule (System.Security.AccessControl.SemaphoreAuditRule rule);
override this.SetAuditRule : System.Security.AccessControl.SemaphoreAuditRule -> unit
Public Sub SetAuditRule (rule As SemaphoreAuditRule)

参数

rule
SemaphoreAuditRule

要添加的 SemaphoreAuditRuleThe SemaphoreAuditRule to add. 由此规则指定的用户确定在添加此规则之前要移除的规则。The user specified by this rule determines the rules to remove before this rule is added.

例外

rulenullrule is null.

注解

如果没有与指定规则匹配的审核规则, rule 则会添加。If there are no audit rules whose user matches the specified rule, rule is added.

适用于