UserInformation.GetLastNameAsync メソッド

定義

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

重要

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

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

戻り値

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

ユーザーの名前 (姓)。

属性

注釈

重要

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

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

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

適用対象

こちらもご覧ください