PermissionSet.Count 属性

定义

获取权限集中包含的权限对象的数目。

public:
 virtual property int Count { int get(); };
public virtual int Count { get; }
member this.Count : int
Public Overridable ReadOnly Property Count As Integer

属性值

PermissionSet 中包含的权限对象的数目。

实现

示例

下面的代码示例演示如何使用 Count 属性来获取权限集中的权限对象数。 此代码示例是为 PermissionSet 类提供的一个更大示例的一部分。

// Display the number of permissions in the set.
Console::WriteLine( "Number of permissions = {0}", ps1->Count );
// Display the number of permissions in the set.
Console.WriteLine("Number of permissions = " + ps1.Count);
' Display the number of permissions in the set.
Console.WriteLine("Number of permissions = " & ps1.Count)

注解

NoneUnrestricted 状态下,这将返回零,因为未使用实际的权限对象实例。

适用于