导出 (0) 打印
全部展开
信息
您所需的主题如下所示。但此主题未包含在此库中。

UserIdentity Class

包含 ID、票证和其他与用户相关的信息.

语法


public ref class UserIdentity sealed 

特性

[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