CngKey.HasProperty(String, CngPropertyOptions) 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
检查密钥上是否存在指定的属性。
public:
 bool HasProperty(System::String ^ name, System::Security::Cryptography::CngPropertyOptions options);public bool HasProperty(string name, System.Security.Cryptography.CngPropertyOptions options);[System.Security.SecurityCritical]
public bool HasProperty(string name, System.Security.Cryptography.CngPropertyOptions options);member this.HasProperty : string * System.Security.Cryptography.CngPropertyOptions -> bool[<System.Security.SecurityCritical>]
member this.HasProperty : string * System.Security.Cryptography.CngPropertyOptions -> boolPublic Function HasProperty (name As String, options As CngPropertyOptions) As Boolean参数
- name
- String
要检查的属性名称。
- options
- CngPropertyOptions
指定已命名属性选项的枚举值的按位组合。
返回
如果找到指定的属性,则为 true;否则为 false。
- 属性
例外
              name 为 null。
注解
参数 options 专门用于指示以下内容:
- 属性是内置属性还是自定义属性。 
- 是否应使用 键保留 属性。 
这些选项必须与设置属性时使用的值匹配,否则将找不到该属性。
即使 属性设置为 false 或零,此方法也能正常运行。