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

# 确定主机所在地区

> 在运行时读取 XBOX 主机所设置的国家/地区（独立于包清单），用于开发感知地理位置的 GDK 游戏。

要读取主机所设置的国家/地区 —— 独立于包清单 —— 请使用 [`GetUserDefaultGeoName`](https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-getuserdefaultgeoname)。这里的“用户”就是当前登录会话;该 API 返回主机所设置的国家/地区。

> [!NOTE]
>
> 当 `GetUserDefaultLocaleName` 返回的区域设置为 `en-GB` 时,`GetUserDefaultGeoName` 就特别有用。有几个国家/地区为了简化处理都使用英国英语区域设置(沙特阿拉伯、阿联酋、捷克、匈牙利、斯洛伐克、希腊)—— 通过地理名称可以区分它们。

## 另请参阅

* [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 features reference](https://docs.xbox.com/zh-CN/reference/system/xgameruntimefeature/xgameruntimefeature_members.md) —— `XSystemGetXboxLiveSandboxId`、支持地区感知的运行时 API
* [XUser API reference](https://docs.xbox.com/zh-CN/reference/system/xuser/xuser_members.md) —— 已登录用户的国家/地区查询


## Related topics

- [XBOX services 安全令牌声明](https://docs.xbox.com/zh-CN/services/xbox-services/fundamentals/s2s-auth-calls/service-authentication/security-tokens/live-token-claims.md)
- [确定主机区域设置与语言](https://docs.xbox.com/zh-CN/build/game-principles/localization/determining-console-locale.md)
- [XPackageGetUserLocale](https://docs.xbox.com/zh-CN/reference/system/xpackage/functions/xpackagegetuserlocale.md)
- [主机上的 Developer Home (Dev Home)](https://docs.xbox.com/zh-CN/tools/tools-console/devhome/devhome.md)
- [设置页面 (Dev Home)](https://docs.xbox.com/zh-CN/tools/tools-console/devhome/devhome-settings.md)
