KeyContainerPermission 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 KeyContainerPermission 类的新实例。
重载
KeyContainerPermission(KeyContainerPermissionFlags) |
使用指定的访问权限初始化 KeyContainerPermission 类的新实例。 |
KeyContainerPermission(PermissionState) |
使用受限制或不受限制的权限初始化 KeyContainerPermission 类的新实例。 |
KeyContainerPermission(KeyContainerPermissionFlags, KeyContainerPermissionAccessEntry[]) |
使用指定的全局访问权限和特定密钥容器访问权限初始化 KeyContainerPermission 类的新实例。 |
KeyContainerPermission(KeyContainerPermissionFlags)
- Source:
- KeyContainerPermission.cs
- Source:
- KeyContainerPermission.cs
- Source:
- KeyContainerPermission.cs
- Source:
- 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)
参数
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)
- Source:
- KeyContainerPermission.cs
- Source:
- KeyContainerPermission.cs
- Source:
- KeyContainerPermission.cs
- Source:
- 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[])
- Source:
- KeyContainerPermission.cs
- Source:
- KeyContainerPermission.cs
- Source:
- KeyContainerPermission.cs
- Source:
- 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())
参数
KeyContainerPermissionFlags 值的按位组合。
- accessList
- KeyContainerPermissionAccessEntry[]
标识特定密钥容器访问权限的 KeyContainerPermissionAccessEntry 对象数组。
例外
flags
不是有效的 KeyContainerPermissionFlags 值组合。
accessList
为 null
。
示例
下面的代码示例演示如何使用 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)