共用方式為


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)

適用於