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

# XSystemAnalyticsInfo

> XSystemAnalyticsInfo

# XSystemAnalyticsInfo

表示有关当前设备的信息。

## Syntax

```cpp theme={null}
typedef struct XSystemAnalyticsInfo {  
    XVersion osVersion;  
    XVersion hostingOsVersion;  
    char family[64];  
    char form[64];  
} XSystemAnalyticsInfo  
```

### Members

*osVersion*\
类型：[XVersion](/reference/system/xgameruntimetypes/structs/xversion)

游戏运行所在的操作系统的版本。对于 XBOX 设备，此值表示主机游戏 OS 的版本。对于桌面设备，此值表示系统 OS 的版本。

*hostingOsVersion*\
类型：[XVersion](/reference/system/xgameruntimetypes/structs/xversion)

启动游戏的操作系统的版本。对于 XBOX 设备，此值表示系统 OS 的版本。对于桌面设备，此值通常与 *osVersion* 的值相同。

*family*\
类型：char\[64]

设备系列的一般说明。示例：“XBOX”和“Windows”。

*form*\
类型：char\[64]

设备系列中特定的硬件类型。示例：“XBOX One X DevKit”。

## Remarks

调用 [XSystemGetAnalyticsInfo](/reference/system/xsystem/functions/xsystemgetanalyticsinfo) 时会返回此结构。该结构提供了当前设备的操作系统版本、设备系列和设备形式。

以下示例说明了如何通过调用 **XSystemGetAnalyticsInfo** 并连接 **XSystemAnalyticsInfo** 的 *osVersion* 成员中返回的结果，来检索游戏所运行的操作系统的版本信息。

```cpp theme={null}
// Get the version of the operating system in which the game is running.
std::string Game::GetGameOSVersion()
{
    // Call XSystemGetAnalyticsInfo()
    XSystemAnalyticsInfo info = XSystemGetAnalyticsInfo();

    // Return a formatted string from the osVersion member of XSystemAnalyticsInfo.
    return std::to_string(info.osVersion.major) + "." +
        std::to_string(info.osVersion.minor) + "." +
        std::to_string(info.osVersion.build) + "." +
        std::to_string(info.osVersion.revision);

}
```

## Requirements

**头文件：** XSystem.h

**受支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## See also

[XSystem](/reference/system/xsystem/xsystem_members)\
[XSystemGetAnalyticsInfo](/reference/system/xsystem/functions/xsystemgetanalyticsinfo)\
[XVersion](/reference/system/xgameruntimetypes/structs/xversion)


## Related topics

- [XSystemGetAnalyticsInfo](/zh-CN/reference/system/xsystem/functions/xsystemgetanalyticsinfo.md)
- [XSystem](/zh-CN/reference/system/xsystem/xsystem_members.md)
- [XVersion](/zh-CN/reference/system/xgameruntimetypes/structs/xversion.md)
- [XSystemRuntimeInfo](/zh-CN/reference/system/xsystem/structs/xsystemruntimeinfo.md)
- [XSystemGetRuntimeInfo](/zh-CN/reference/system/xsystem/functions/xsystemgetruntimeinfo.md)
