PrincipalCollection.Clear 方法

定义

从集合中删除所有 Principal 对象。Removes all Principal objects from the collection.

public:
 virtual void Clear();
public void Clear ();
[System.Security.SecurityCritical]
public void Clear ();
abstract member Clear : unit -> unit
override this.Clear : unit -> unit
Public Sub Clear ()

实现

属性

注解

此函数可能会引发以下异常:This function can throw the following exceptions:

例外Exception 说明Description
InvalidOperationException 如果在 Members PrincipalCollection 上调用此方法,则不能清除 @no__t 1 属性,因为一个或多个组的成员将该组作为其主要组。If this method is called on the Members PrincipalCollection, the Members property cannot be cleared because one or more of the group's members have this group as their primary group.

适用于