UserInformation.GetDomainNameAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the domain name for the user.
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 ^> ^ GetDomainNameAsync();
/// [Windows.Foundation.Metadata.RemoteAsync]
static IAsyncOperation<winrt::hstring> GetDomainNameAsync();
/// [Windows.Foundation.Metadata.RemoteAsync]
/// [Windows.Foundation.Metadata.Deprecated("Use User instead of UserInformation. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.System.UserProfile.UserProfileContract")]
static IAsyncOperation<winrt::hstring> GetDomainNameAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<string> GetDomainNameAsync();
[Windows.Foundation.Metadata.RemoteAsync]
[Windows.Foundation.Metadata.Deprecated("Use User instead of UserInformation. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.System.UserProfile.UserProfileContract")]
public static IAsyncOperation<string> GetDomainNameAsync();
function getDomainNameAsync()
Public Shared Function GetDomainNameAsync () As IAsyncOperation(Of String)
Returns
A string that represents the domain name for the user.
- Attributes
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 domain 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.