gpt4 book ai didi

c++ - GetVersionEx Windows 10 检测为 Windows 8

转载 作者:太空宇宙 更新时间:2023-11-04 12:32:05 36 4
gpt4 key购买 nike

<分区>

我正在使用 GetVersionEx 获取操作系统。但我不知道为什么它报告Windows 10 为Windows 8?我知道它已被弃用,但我找不到其他解决方案。

switch (osinfo.dwMajorVersion)
{
case 5:
if (osinfo.dwMinorVersion == 0)
{
sysinfo = "Windows 2000 ";
}
else if (osinfo.dwMinorVersion == 1)
{
sysinfo = "Windows XP ";
}
else if (osinfo.dwMinorVersion == 2)
{
sysinfo = "Windows XP ";
}
break;
case 6:
if (osinfo.dwMinorVersion == 3)
{
sysinfo = "Windows 8.1 ";
}
else if (osinfo.dwMinorVersion == 2)
{
sysinfo = "Windows 8 ";
}
else if (osinfo.dwMinorVersion == 1)
{
sysinfo = "Windows 7 ";
}
else {
sysinfo = "Windows Vista ";
}
break;
case 10:
sysinfo = "Windows 10 ";
break;
default:
sysinfo = "Unknown OS ";
}

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com