GenericPrincipal.Identity 属性

定义

获取当前 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.IIdentity
Public Overrides ReadOnly Property Identity As IIdentity
Public 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)

适用于