GenericPrincipal.Identity 属性  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取当前 GenericIdentity 表示的用户的 GenericPrincipal。
public:
 virtual property System::Security::Principal::IIdentity ^ Identity { System::Security::Principal::IIdentity ^ get(); };public override System.Security.Principal.IIdentity Identity { get; }public virtual System.Security.Principal.IIdentity Identity { get; }member this.Identity : System.Security.Principal.IIdentityPublic Overrides ReadOnly Property Identity As IIdentityPublic Overridable ReadOnly Property Identity As IIdentity属性值
GenericIdentity 表示的用户的 GenericPrincipal。
实现
示例
以下代码演示如何使用 Identity 属性。 此代码示例是为 GenericPrincipal 类提供的一个更大示例的一部分。
GenericIdentity^ principalIdentity =
   dynamic_cast<GenericIdentity^>(genericPrincipal->Identity);
GenericIdentity principalIdentity = 
    (GenericIdentity)genericPrincipal.Identity;
Dim principalIdentity As GenericIdentity = _
    CType(genericPrincipal.Identity, GenericIdentity)