Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UserInformation class

Applies to Windows and Windows Phone

Gets or sets information about the user, such as name and account picture.

Syntax


var userInformation = Windows.System.UserProfile.UserInformation;

Attributes

[Version(0x06020000)]

Members

The UserInformation class has these types of members:

Events

The UserInformation class has these events.

EventDescription
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.

MethodDescription
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.

PropertyAccess typeDescription

AccountPictureChangeEnabled

Read-onlyDetermines if the user's account picture can be changed.

NameAccessAllowed

Read-onlyAllows 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 only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.System.UserProfile
Windows::System::UserProfile [C++]

Metadata

Windows.winmd

 

 

Show:
© 2014 Microsoft