PipeSecurity.SetAccessRule(PipeAccessRule) 方法

定义

在与当前 PipeSecurity 对象关联的自定义访问控制列表 (DACL) 中设置访问规则。Sets an access rule in the Discretionary Access Control List (DACL) that is associated with the current PipeSecurity object.

public:
 void SetAccessRule(System::IO::Pipes::PipeAccessRule ^ rule);
public void SetAccessRule (System.IO.Pipes.PipeAccessRule rule);
override this.SetAccessRule : System.IO.Pipes.PipeAccessRule -> unit
Public Sub SetAccessRule (rule As PipeAccessRule)

参数

rule
PipeAccessRule

要设置的规则。The rule to set.

例外

rule 参数为 nullThe rule parameter is null.

注解

SetAccessRule方法添加指定的访问控制列表 (ACL) 规则或覆盖与参数的值匹配的所有相同 ACL 规则 PipeAccessRights ruleThe SetAccessRule method adds the specified access control list (ACL) rule or overwrites any identical ACL rules that match the PipeAccessRights value of the rule parameter. 例如,如果 rule 参数指定了一个 Read 值,并且该 SetAccessRule 方法找到了指定该值的相同 ACL 规则 Read ,则将覆盖相同的规则。For example, if the rule parameter specifies a Read value and the SetAccessRule method finds an identical ACL rule that specifies the Read value, the identical rule will be overwritten. 如果 SetAccessRule 方法找到指定值的相同 ACL 规则 Write ,则不会覆盖相同的规则。If the SetAccessRule method finds an identical ACL rule that specifies the Write value, the identical rule will not be overwritten.

适用于