UserInformation.GetFirstNameAsync メソッド

定義

ユーザーの名を取得します。

重要

UserInformation クラスは、Windows 10以降ではサポートされていません。 代わりに User クラスを使用してください。 UserInformation クラスのドキュメントの「解説」を参照してください。

public:
 static IAsyncOperation<Platform::String ^> ^ GetFirstNameAsync();
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<winrt::hstring> GetFirstNameAsync();
/// [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> GetFirstNameAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<string> GetFirstNameAsync();
[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> GetFirstNameAsync();
function getFirstNameAsync()
Public Shared Function GetFirstNameAsync () As IAsyncOperation(Of String)

戻り値

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

ユーザーの名前 (名)。

属性

注釈

重要

UserInformation クラスは、Windows 10以降ではサポートされていません。 代わりに User クラスを使用してください。 UserInformation クラスのドキュメントの「解説」を参照してください。

ユーザーの名へのアクセスは、プライバシー設定によってブロックできます (たとえば、 UserInformation.NameAccessAllowed プロパティが false の場合)。 アクセスがブロックされている場合、このメソッドは空の文字列を返します。

このメソッドは例外をスローしません。

適用対象

こちらもご覧ください