Gets or sets information about the user, such as name and account picture.
Syntax
public static class UserInformation : Object
Attributes
- DualApiPartitionAttribute()
- StaticAttribute(Windows.System.UserProfile.IUserInformationStatics, NTDDI_WIN8)
- VersionAttribute(NTDDI_WIN8)
Members
The UserInformation class has these types of members:
Events
The UserInformation class has these events.
| Event | Description |
|---|---|
| AccountPictureChanged | Occurs when the user's image or name changes. |
Methods
The UserInformation class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| GetAccountPicture | Gets the account picture for the user. |
| GetDisplayNameAsync | Gets the display name for the user account. |
| GetDomainNameAsync | Gets the domain name for the user. |
| GetFirstNameAsync | Gets the user's first name. |
| GetLastNameAsync | Gets the user's last name. |
| GetPrincipalNameAsync | Gets the principal name for the user. This name is the User Principal Name (typically the user's address, although this is not always true.) |
| GetSessionInitiationProtocolUriAsync | Gets the Uniform Resource Identifier (URI) of the session initiation protocol for the user. |
| SetAccountPictureAsync | Sets the picture for the user's account using an IStorageFile object. |
| SetAccountPictureFromStreamAsync | Sets the picture for the user's account using an IRandomAccessStream object. |
| SetAccountPicturesAsync | Sets the pictures for the user's account using an IStorageFile object. Supports adding a small image, large image, and video. |
| SetAccountPicturesFromStreamsAsync | Sets the pictures for the user's account using an IRandomAccessStream object. Supports adding a small image, large image, and video. |
Properties
The UserInformation class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Determines if the user's account picture can be changed. | |
| Read-only | Allows you to see if your app is allowed to access the user's information. |
Remarks
To be launched in account picture mode and to set the user's picture without additional prompting, an app must register as an account picture provider by including the following in the Extensions section of the app manifest.
<Extension Category="windows.accountPictureProvider" />
Examples
function getUserInfo() { image = Windows.System.UserProfile.UserInformation.getAccountPicture(Windows.System.UserProfile.AccountPictureKind.smallImage); imageURL = URL.createObjectURL(image, false); }
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps, desktop apps] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps, desktop apps] |
|
Namespace |
|
|
Metadata |
|
Build date: 12/4/2012