共用方式為


IAssociatedIdentityProvider::AssociateIdentity 方法 (identityprovider.h)

AssociateIdentity方法會將身分識別與本機使用者帳戶產生關聯。

語法

HRESULT AssociateIdentity(
  [in]  HWND           hwndParent,
  [out] IPropertyStore **ppPropertyStore
);

參數

[in] hwndParent

用來收集帳號憑證的視窗父系控制碼。

[out] ppPropertyStore

與身分識別相關聯的 IPropertyStore 介面指標。

傳回值

如果方法成功,則會傳回 S_OK

如果方法失敗,則會傳回錯誤碼。 如需常見錯誤碼的清單,請參閱 一般 HRESULT 值

備註

此方法應該呼叫 CredUIPromptForWindowsCredentials 以收集帳號憑證。

需求

   
最低支援的用戶端 Windows 7 [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2008 R2 [僅限傳統型應用程式]
目標平台 Windows
標頭 identityprovider.h

另請參閱

IAssociatedIdentityProvider