語言

SystemIdentification.GetSystemIdForUser(User) 方法

定義

會根據使用者 ID 取得系統識別碼值。

public:
 static SystemIdentificationInfo ^ GetSystemIdForUser(User ^ user);
 static SystemIdentificationInfo GetSystemIdForUser(User const& user);
public static SystemIdentificationInfo GetSystemIdForUser(User user);
function getSystemIdForUser(user)
Public Shared Function GetSystemIdForUser (user As User) As SystemIdentificationInfo

參數

user
User

使用者資料用於建立系統 ID。 如果值為 null,此方法會取得目前使用者的 ID。

傳回

此系統的 SystemIdentificationInfo 物件,基於使用者 ID。

Windows 需求

規格需求 Description
應用程式功能
userSystemId

備註

此方法回傳的識別碼是針對當前裝置上的使用者,並允許在同一裝置上執行的不同應用程式間對特定使用者進行使用情況的關聯。 不支援多使用者的應用程式應該只會進入 null 這個方法,該方法會取得目前使用者的 ID。

此方法的使用受限於 userSystemId 能力,該功能需經 Microsoft 核准。 請注意,大多數來電者應該改用 Windows。改用 System.Profile.SystemIdentification.GetSystemIdForPublisher 方法,因為它更適合大多數使用情境,且不需要受限功能。 如果你不需要取得一個在不同出版商開發的應用程式間共享的 ID,就不應該使用這種方法。

備註

此方法回傳用於關聯的識別碼,且不提供物件。User 要存取目前使用者的屬性(例如顯示名稱或帳號名稱),請使用 Windows。System.User.GetDefault(Windows 10,版本 2104+),然後透過 User.GetPropertyAsync 與 KnownUserProperties 查詢屬性(需要 userAccountInformation 功能)。

適用於