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)

備註

在 或 Unrestricted 狀態中 None ,這會傳回零,因為不會使用實際的權限物件實例。

適用於