> ## 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.

# 判斷主機位置

> 在 GDK 遊戲中呼叫 GetUserDefaultGeoName,以在執行階段擷取 XBOX 主機的國家/地區,不受套件資訊清單地區設定的影響。

若要擷取主機所設定的國家/地區 (不受套件資訊清單影響),請使用 [`GetUserDefaultGeoName`](https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-getuserdefaultgeoname)。此處的「使用者」是指已登入的工作階段;此 API 會傳回主機所設定的國家/地區。

<Note>
  當 `GetUserDefaultLocaleName` 傳回的地區設定為 `en-GB` 時,`GetUserDefaultGeoName` 就很有用。為了簡化,有數個國家/地區使用英式英文地區設定 (沙烏地阿拉伯、阿拉伯聯合大公國、捷克共和國、匈牙利、斯洛伐克、希臘),而地理名稱可用來區分它們。
</Note>

## 另請參閱

* [GetUserDefaultGeoName](https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-getuserdefaultgeoname)
* [GetUserDefaultLocaleName](https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-getuserdefaultlocalename)

## 相關 API 文件

* [XGameRuntime 功能參考](/zh-TW/reference/system/xgameruntimefeature/xgameruntimefeature_members):`XSystemGetXboxLiveSandboxId`、可感知區域的執行階段 API
* [XUser API 參考](/zh-TW/reference/system/xuser/xuser_members):已登入使用者的國家/地區查詢


## Related topics

- [判斷主機的地區設定與語言](/zh-TW/build/game-principles/localization/determining-console-locale.md)
- [XPackageGetUserLocale](/zh-TW/reference/system/xpackage/functions/xpackagegetuserlocale.md)
- [IXtfConsoleControlClient::QueryConnectedStandby](/zh-TW/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_queryconnectedstandby.md)
- [IXtfConsoleControlClient::QueryConnectedStandbyEx](/zh-TW/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_queryconnectedstandbyex.md)
- [XBOX 服務安全性權杖宣告](/zh-TW/services/xbox-services/fundamentals/s2s-auth-calls/service-authentication/security-tokens/live-token-claims.md)
