9

Windows 8 uses Live ID as the user name. How do I get this LiveID in C#?

Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
user1343145
  • 217
  • 2
  • 5

3 Answers3

6

Metro apps by design have restricted access to many information they shouldn't really need, and I think this might be one of them.

WinRT gives access to Windows.System.UserProfile.UserInformation class (as CodeCaster suggested), but as I checked, from all the methods there only GetDisplayNameAsync() might return live id (email) and it's only if the first/last name are not set on the account.

(Also, most of the methods in this class require setting Enterprise Authentication capability, which is not really welcome in the Store. And the documentation of the class is currently poor.)

For single-sign-on experience, you might rather use Live Software Development Kit.

Paweł Bulwan
  • 8,467
  • 5
  • 39
  • 50
1

Take a look at the following post:

http://www.silverlightshow.net/items/Using-the-Live-SDK-in-Windows-8-XAML-C-Metro-Applications.aspx

also on previous questions:

Log in to desktop application by Windows Live ID

Windows Live ID login via HttpRequest

Community
  • 1
  • 1
Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
1

Perhaps Windows.System.UserProfile.UserInformation contain some relevant data.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
  • I tried reference the Windows.System namespace, but I can't find it in a newly created WPF solution, even if the solution is using .NET Framework 4.5, can you tell me how do I see the namespace of Windows.System? Thanks a lot. – user1343145 Apr 23 '12 at 10:03
  • @user1343145 - it is a WinRT only feature, not a .NET 4.5 feature – Robert MacLean Aug 27 '12 at 16:22