Skip to main content
UserInformation.GetDisplayNameAsync | getDisplayNameAsync method

Gets the display name for the user account.

Syntax


Windows.System.UserProfile.UserInformation.getDisplayNameAsync().done( /* Your success and error handlers */ );

public static IAsyncOperation<string> GetDisplayNameAsync()

Public Shared Function GetDisplayNameAsync() As IAsyncOperation(Of String)

public:
static IAsyncOperation<String^>^ GetDisplayNameAsync()

Parameters

This method has no parameters.

Return value

Type: IAsyncOperation<String>

The display name for the user account.

Remarks

Access to the display 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.

To see how to use this method check out our code sample.

Requirements ( device family)

Device family

Desktop
Mobile

API contract

Windows.System.UserProfile.UserProfileContract, introduced version 1.0

Namespace

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

Metadata

Windows.System.UserProfile.UserProfileContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

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

Metadata

Windows.winmd

See also

UserInformation