UserInformation Class
Obtient ou définit les informations sur l'utilisateur, telles que le nom et l'image de compte.
Syntaxe
var userInformation = Windows.System.UserProfile.UserInformation;
Attributs
- DualApiPartitionAttribute()
- StaticAttribute(Windows.System.UserProfile.IUserInformationStatics, NTDDI_WIN8)
- VersionAttribute(NTDDI_WIN8)
Membres
UserInformationClasse comporte les types de membres suivants :
Événements
UserInformationClasse comporte les événements suivants.
| Événement | Description |
|---|---|
| AccountPictureChanged | Occurs when the user's image or name changes. |
Méthodes
The UserInformation Classe comporte les méthodes suivantes. Avec C#, Visual Basic et C++, il hérite également des méthodes de Object Classe.
| Méthode | 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. |
Propriétés
Le UserInformationClasse contient les propriétés suivantes.
| Propriété | Type d’accès | Description |
|---|---|---|
| en lecture seule | Determines if the user's account picture can be changed. | |
| en lecture seule | Allows you to see if your app is allowed to access the user's information. |
Remarques
Pour être exécuté en mode d'image de compte et pour définir l'image de l'utilisateur sans invite supplémentaire, une application doit s'enregistrer en tant que fournisseur d'image de compte en incluant ce qui suit dans la section Extensions du manifeste d'application.
<Extension Category="windows.accountPictureProvider" />
Exemples
function getUserInfo() { image = Windows.System.UserProfile.UserInformation.getAccountPicture(Windows.System.UserProfile.AccountPictureKind.smallImage); imageURL = URL.createObjectURL(image, false); }
Configuration requise
|
Client minimal pris en charge | Windows 8 [Applications du Windows Store, applications de bureau] |
|---|---|
|
Serveur minimal pris en charge | Windows Server 2012 [Applications du Windows Store, applications de bureau] |
|
Espace de noms |
|
|
Métadonnées |
|
