GenericPrincipal.Identity 属性

定义

获取当前 GenericIdentity 表示的用户的 GenericPrincipalGets the GenericIdentity of the user represented by the current GenericPrincipal.

public:
 virtual property System::Security::Principal::IIdentity ^ Identity { System::Security::Principal::IIdentity ^ get(); };
public virtual System.Security.Principal.IIdentity Identity { get; }
member this.Identity : System.Security.Principal.IIdentity
Public Overridable ReadOnly Property Identity As IIdentity

属性值

GenericIdentity 表示的用户的 GenericPrincipalThe GenericIdentity of the user represented by the GenericPrincipal.

示例

下面的代码演示Identity属性的用法。The following code shows the use of the Identity property. 此代码示例是为GenericPrincipal类提供的更大示例的一部分。This code example is part of a larger example provided for the GenericPrincipal class.

GenericIdentity^ principalIdentity =
   dynamic_cast<GenericIdentity^>(genericPrincipal->Identity);
GenericIdentity principalIdentity = 
    (GenericIdentity)genericPrincipal.Identity;
Dim principalIdentity As GenericIdentity = _
    CType(genericPrincipal.Identity, GenericIdentity)

适用于