共用方式為


KeyContainerPermission 建構函式

定義

初始化 KeyContainerPermission 類別的新執行個體。

多載

KeyContainerPermission(KeyContainerPermissionFlags)

使用指定陣列,初始化 KeyContainerPermission 類別的新執行個體。

KeyContainerPermission(PermissionState)

使用限制或無限制的權限,初始化 KeyContainerPermission 類別的新執行個體。

KeyContainerPermission(KeyContainerPermissionFlags, KeyContainerPermissionAccessEntry[])

以指定全域存取與特定金鑰容器存取權限,初始化 KeyContainerPermission 類別的新執行個體。

KeyContainerPermission(KeyContainerPermissionFlags)

來源:
KeyContainerPermission.cs
來源:
KeyContainerPermission.cs
來源:
KeyContainerPermission.cs
來源:
KeyContainerPermission.cs

使用指定陣列,初始化 KeyContainerPermission 類別的新執行個體。

public:
 KeyContainerPermission(System::Security::Permissions::KeyContainerPermissionFlags flags);
public KeyContainerPermission (System.Security.Permissions.KeyContainerPermissionFlags flags);
new System.Security.Permissions.KeyContainerPermission : System.Security.Permissions.KeyContainerPermissionFlags -> System.Security.Permissions.KeyContainerPermission
Public Sub New (flags As KeyContainerPermissionFlags)

參數

例外狀況

flags 不是 KeyContainerPermissionFlags 值的有效組合。

範例

下列程式代碼範例示範建構函式的使用 KeyContainerPermission.KeyContainerPermission(KeyContainerPermissionFlags) 方式。

// Create a KeyContainerPermission with the right to open the key container.
KeyContainerPermission ^ keyContainerPerm = gcnew KeyContainerPermission( KeyContainerPermissionFlags::Open );
// Create a KeyContainerPermission with the right 
// to open the key container.
KeyContainerPermission keyContainerPerm = new
     KeyContainerPermission(KeyContainerPermissionFlags.Open);
' Create a KeyContainerPermission with the right to open the key container.
Dim keyContainerPerm As New KeyContainerPermission(KeyContainerPermissionFlags.Open)

適用於

KeyContainerPermission(PermissionState)

來源:
KeyContainerPermission.cs
來源:
KeyContainerPermission.cs
來源:
KeyContainerPermission.cs
來源:
KeyContainerPermission.cs

使用限制或無限制的權限,初始化 KeyContainerPermission 類別的新執行個體。

public:
 KeyContainerPermission(System::Security::Permissions::PermissionState state);
public KeyContainerPermission (System.Security.Permissions.PermissionState state);
new System.Security.Permissions.KeyContainerPermission : System.Security.Permissions.PermissionState -> System.Security.Permissions.KeyContainerPermission
Public Sub New (state As PermissionState)

參數

state
PermissionState

其中一個 PermissionState 值。

例外狀況

state 不是有效的 PermissionState 值。

備註

None 建立 (完全受限) 或Unrestricted金鑰容器的存取權。

適用於

KeyContainerPermission(KeyContainerPermissionFlags, KeyContainerPermissionAccessEntry[])

來源:
KeyContainerPermission.cs
來源:
KeyContainerPermission.cs
來源:
KeyContainerPermission.cs
來源:
KeyContainerPermission.cs

以指定全域存取與特定金鑰容器存取權限,初始化 KeyContainerPermission 類別的新執行個體。

public:
 KeyContainerPermission(System::Security::Permissions::KeyContainerPermissionFlags flags, cli::array <System::Security::Permissions::KeyContainerPermissionAccessEntry ^> ^ accessList);
public KeyContainerPermission (System.Security.Permissions.KeyContainerPermissionFlags flags, System.Security.Permissions.KeyContainerPermissionAccessEntry[] accessList);
new System.Security.Permissions.KeyContainerPermission : System.Security.Permissions.KeyContainerPermissionFlags * System.Security.Permissions.KeyContainerPermissionAccessEntry[] -> System.Security.Permissions.KeyContainerPermission
Public Sub New (flags As KeyContainerPermissionFlags, accessList As KeyContainerPermissionAccessEntry())

參數

accessList
KeyContainerPermissionAccessEntry[]

KeyContainerPermissionAccessEntry 物件的陣列,可識別特定金鑰容器存取權限。

例外狀況

flags 不是 KeyContainerPermissionFlags 值的有效組合。

accessListnull

範例

下列程式代碼範例示範建構函式的使用 KeyContainerPermission.KeyContainerPermission(KeyContainerPermissionFlags, KeyContainerPermissionAccessEntry[]) 方式。

// Create an array of KeyContainerPermissionAccessEntry objects
array<KeyContainerPermissionAccessEntry^>^keyContainerPermAccEntryArray = {keyContainerPermAccEntry1,keyContainerPermAccEntry2};

// Create a new KeyContainerPermission using the array.
KeyContainerPermission ^ keyContainerPerm2 = gcnew KeyContainerPermission( KeyContainerPermissionFlags::AllFlags,keyContainerPermAccEntryArray );
// Create an array of KeyContainerPermissionAccessEntry objects
KeyContainerPermissionAccessEntry[] keyContainerPermAccEntryArray 
    = { keyContainerPermAccEntry1, keyContainerPermAccEntry2 };

// Create a new KeyContainerPermission using the array.
KeyContainerPermission keyContainerPerm2 = 
    new KeyContainerPermission(
    KeyContainerPermissionFlags.AllFlags,
    keyContainerPermAccEntryArray);
' Create an array of KeyContainerPermissionAccessEntry objects
Dim keyContainerPermAccEntryArray As KeyContainerPermissionAccessEntry() = _
    {keyContainerPermAccEntry1, keyContainerPermAccEntry2}

' Create a new KeyContainerPermission using the array.
Dim keyContainerPerm2 As _
    New KeyContainerPermission(KeyContainerPermissionFlags.AllFlags, keyContainerPermAccEntryArray)

適用於