UserIdentity Class

包含使用者的識別碼、票證和其他相關資訊。.

語法


Public NotInheritable Class UserIdentity

屬性

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

成員

UserIdentity類別 有這些類型的成員:

方法

The UserIdentity 類別 繼承來自以下項目的方法 Object 類別 (C#/VB/C++).

屬性

UserIdentity類別 有這些內容。

屬性存取類型說明

FirstName

唯讀Contains the first name of the user. This value is available only to Microsoft application partners.

Id

唯讀Gets the user's unique Microsoft account identifier. This value is available only to Microsoft application partners.

IsBetaAccount

唯讀Indicates if the user is part of a beta program. This value is available only to Microsoft application partners.

IsConfirmedPC

唯讀Indicates if the user is on a PC that they have confirmed as their PC. This value is available only to Microsoft application partners.

LastName

唯讀Contains the user's last name. This value is available only to Microsoft application partners.

SafeCustomerId

唯讀Gets an obfuscated customer ID specific to the calling application.

SignInName

唯讀The sign in name of the user. This value is available only to Microsoft application partners.

Tickets

唯讀Contains an array of tickets that identify the user

 

範例


List<OnlineIdServiceTicketRequest> targetArray = new List<OnlineIdServiceTicketRequest>();
targetArray.Add(new OnlineIdServiceTicketRequest("wl.basic wl.contacts_photos wl.calendars",
        "DELEGATION"));

DebugPrint("Signing in ...");

Windows.Security.Authentication.OnlineId.UserIdentity result = 
        await _authenticator.AuthenticateUserAsync(targetArray, CredentialPromptType.PromptIfNeeded);

if (result.Tickets[0].Value != string.Empty)
{
    DebugPrint("Signed in.");
    IsNotSignedIn = false;
}
else
{
    // Handle errors like bad parameter, misconfigured target, and so on.
    DebugPrint("Unable to get the ticket. Error: " + result.Tickets[0].ErrorCode.ToString());
    IsNotSignedIn = true;
}

需求

最低支援的用戶端

Windows 8 [僅限 Windows 市集應用程式]

最低支援的伺服器

Windows Server 2012 [僅限 Windows 市集應用程式]

最低支援的電話

Windows Phone 8

命名空間

Windows.Security.Authentication.OnlineId
Windows::Security::Authentication::OnlineId [C++]

中繼資料

Windows.winmd

 

 

顯示:
© 2014 Microsoft