【发布时间】:2012-04-23 08:51:38
【问题描述】:
Windows 8 使用 Live ID 作为用户名。如何在 C# 中获取此 LiveID?
【问题讨论】:
-
你到底想做什么?更多数据会有所帮助...
Windows 8 使用 Live ID 作为用户名。如何在 C# 中获取此 LiveID?
【问题讨论】:
Metro 应用程序在设计上限制了对许多他们不应该真正需要的信息的访问,我认为这可能就是其中之一。
WinRT 提供对 Windows.System.UserProfile.UserInformation 类的访问权限(正如 CodeCaster 建议的那样),但正如我检查的那样,从那里的所有方法中,只有 GetDisplayNameAsync() 可能返回实时 ID(电子邮件),并且只有在未设置名字/姓氏的情况下在帐户上。
(另外,这个类中的大部分方法都需要设置企业认证能力,即not really welcome in the Store。而the documentation of the class目前很差。)
对于single-sign-on experience,您可能更愿意使用 Live Software Development Kit。
【讨论】:
也许Windows.System.UserProfile.UserInformation 包含一些相关数据。
【讨论】: