- Visual Studio 2013
- MS-LPL
- HTML5
- Windows Runtime
- Controls
- 11/25/2013
This sample demonstrates different ways of getting the name of the user that is currently logged in. It also demonstrates how to get and set the image used for the user's tile.
Specifically, this sample demonstrates the following scenarios:
- How to get the DisplayName for the current logged on user.
- How to get the first and last name for the current logged on user. (This is only available for Microsoft accounts. An empty string is returned if a Microsoft account is not available.)
- How to obtain the logged on user's account picture as a bitmap. You can get request three different types: small, large, and video. If the size that is requested is not available an empty file is returned.
- How to set the account picture for the currently logged on user. You can set three different types: small, large, and video. (More than one type can be set in the same call, but a small image must be accompanied by a large image and/or video.)
- How to register for a change event for account picture updates.
Check out Windows.System.UserProfile for info about the classes and methods used in this sample.
To obtain an evaluation copy of Windows 8.1, go to Windows 8.1.
To obtain an evaluation copy of Microsoft Visual Studio 2013, go to Visual Studio 2013.
Note For Windows 8 app samples, download the Windows 8 app samples pack. The samples in the Windows 8 app samples pack will build and run only on Microsoft Visual Studio 2012.
Client | |
---|---|
Server |
- Start Visual Studio 2013 and select File > Open > Project/Solution.
- Go to the directory in which you unzipped the sample. Go to the directory named for the sample, and double-click the Microsoft Visual Studio Solution (.sln) file.
- Press F7 or use Build > Build Solution to build the sample.
To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.