> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFAccountManagementClientLinkBattleNetAccountAsync

> 用戶端 API，可在 Windows 上將與權杖相關聯的 Battle.net 帳戶連結至使用者的 PlayFab 帳戶。另請參閱 ClientLoginWithBattleNetAsync。

將與權杖相關聯的 Battle.net 帳戶連結至使用者的 PlayFab 帳戶。

## 語法

```cpp theme={null}
HRESULT PFAccountManagementClientLinkBattleNetAccountAsync(  
    PFEntityHandle entityHandle,  
    const PFAccountManagementClientLinkBattleNetAccountRequest* request,  
    XAsyncBlock* async  
)  
```

### 參數

**`entityHandle`**   PFEntityHandle

用於驗證的 PFEntityHandle。

**`request`**   [PFAccountManagementClientLinkBattleNetAccountRequest\*](/zh-TW/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementclientlinkbattlenetaccountrequest)

已填入的要求物件。

**`async`**   XAsyncBlock\*<br />*Inout*

用於非同步作業的 XAsyncBlock。

### 傳回值

類型：HRESULT

此 API 作業的結果代碼。

## 備註

此 API 可在 Windows 上使用。另請參閱 ClientLoginWithBattleNetAsync、ClientUnlinkBattleNetAccountAsync。呼叫 XAsyncGetStatus 以取得作業的狀態。如果服務呼叫失敗，非同步結果將為 E\_PF\_BATTLE\_NET\_NOT\_ENABLED\_FOR\_TITLE、E\_PF\_INVALID\_IDENTITY\_PROVIDER\_ID、E\_PF\_LINKED\_IDENTIFIER\_ALREADY\_CLAIMED、E\_PF\_TOKEN\_SIGNING\_KEY\_NOT\_FOUND 或任何全域 PlayFab 服務錯誤。如需錯誤處理的詳細資訊，請參閱文件頁面「Handling PlayFab Errors」。

## 需求

**標頭：** PFAccountManagement.h

## 另請參閱

[PFAccountManagement 成員](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members)


## Related topics

- [服務 C API 概觀 - PFAccountManagement.h](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members.md)
- [PFAccountManagementClientLinkBattleNetAccountRequest](/zh-TW/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementclientlinkbattlenetaccountrequest.md)
- [PFAccountManagementClientUnlinkBattleNetAccountAsync](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientunlinkbattlenetaccountasync.md)
- [PFAccountManagementServerLinkBattleNetAccountAsync](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverlinkbattlenetaccountasync.md)
- [Link Battle Net Account](/api-reference/account-management/link-battle-net-account.md)
