UserInformation.GetFirstNameAsync UserInformation.GetFirstNameAsync UserInformation.GetFirstNameAsync UserInformation.GetFirstNameAsync UserInformation.GetFirstNameAsync Method

Definition

Gets the user's first name.

Important

The UserInformation class is not supported on Windows 10 or later. Use the User class instead. See Remarks in the UserInformation class documentation.

public : static IAsyncOperation<Platform::String> GetFirstNameAsync()
static IAsyncOperation<winrt::hstring> GetFirstNameAsync() const;
public static IAsyncOperation<string> GetFirstNameAsync()
Public Shared Function GetFirstNameAsync() As IAsyncOperation(Of string)
Windows.System.UserProfile.UserInformation.getFirstNameAsync().done( /* Your success and error handlers */ );
Returns

Remarks

Important

The UserInformation class is not supported on Windows 10 or later. Use the User class instead. See Remarks in the UserInformation class documentation.

Access to the user's first name can be blocked by privacy settings (for example, if the UserInformation::NameAccessAllowed property is false). If access is blocked, this method returns an empty string.

This method does not throw an exception.

See Also