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

# 确定主机所在地区

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

要读取主机所设置的国家/地区 —— 独立于包清单 —— 请使用 [`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 features reference](/reference/system/xgameruntimefeature/xgameruntimefeature_members) —— `XSystemGetXboxLiveSandboxId`、支持地区感知的运行时 API
* [XUser API reference](/reference/system/xuser/xuser_members) —— 已登录用户的国家/地区查询


## Related topics

- [确定主机区域设置与语言](/zh-CN/build/game-principles/localization/determining-console-locale.md)
- [XPackageGetUserLocale](/zh-CN/reference/system/xpackage/functions/xpackagegetuserlocale.md)
- [设置页面 (Dev Home)](/zh-CN/tools/tools-console/devhome/devhome-settings.md)
- [PAGE 101 · 无障碍活动注册指南](/zh-CN/build/game-principles/accessibility/page/page-101-registration.md)
- [主机上的 Developer Home (Dev Home)](/zh-CN/tools/tools-console/devhome/devhome.md)
