1个回答
展开全部
GetUserName(LPWSTR lpBuffer, LPDWORD nSize);
lpBuffer是一个数组的地址,用来存贮得到的用户名,nsize是个指针,指向此存贮此数组大小的单元,就是数组能存贮的字符数量
GetVersionExW(LPOSVERSIONINFOW);
参数LPOSVERSIONINFO是一个指向OSVERSIONINFO类型变量的指针,
具体判断代码如下
定义 OSVERSIONINFO osvi;
然后调用函数取得版本号,判断如下
switch (osvi.dwPlatformId)
{
case VER_PLATFORM_WIN32_NT:
if (osvi.dwMajorVersion == 5&&osvi.dwMinorVersion == 0)
{
strOSVersion = TEXT("Windows 2000");
}
else if (osvi.dwMajorVersion == 5&&osvi.dwMinorVersion == 1)
{
strOSVersion = TEXT("Windows XP");
}
else if(osvi.dwMajorVersion == 6&&osvi.dwMinorVersion == 0)
{
strOSVersion = TEXT("Windows Vista");
}
else if (osvi.dwMajorVersion == 4&&osvi.dwMinorVersion == 0)
{
strOSVersion = TEXT("Windows NT");
}
break;
case VER_PLATFORM_WIN32_WINDOWS:
if (osvi.dwMajorVersion == 4&&osvi.dwMinorVersion == 10)
{
strOSVersion = TEXT("Windows 98");
}
else if (osvi.dwMajorVersion == 4&&osvi.dwMinorVersion == 90)
{
strOSVersion = TEXT("Windows ME");
}
else
{
strOSVersion = TEXT("Windows 95");
}
break;
default:
break;
}
lpBuffer是一个数组的地址,用来存贮得到的用户名,nsize是个指针,指向此存贮此数组大小的单元,就是数组能存贮的字符数量
GetVersionExW(LPOSVERSIONINFOW);
参数LPOSVERSIONINFO是一个指向OSVERSIONINFO类型变量的指针,
具体判断代码如下
定义 OSVERSIONINFO osvi;
然后调用函数取得版本号,判断如下
switch (osvi.dwPlatformId)
{
case VER_PLATFORM_WIN32_NT:
if (osvi.dwMajorVersion == 5&&osvi.dwMinorVersion == 0)
{
strOSVersion = TEXT("Windows 2000");
}
else if (osvi.dwMajorVersion == 5&&osvi.dwMinorVersion == 1)
{
strOSVersion = TEXT("Windows XP");
}
else if(osvi.dwMajorVersion == 6&&osvi.dwMinorVersion == 0)
{
strOSVersion = TEXT("Windows Vista");
}
else if (osvi.dwMajorVersion == 4&&osvi.dwMinorVersion == 0)
{
strOSVersion = TEXT("Windows NT");
}
break;
case VER_PLATFORM_WIN32_WINDOWS:
if (osvi.dwMajorVersion == 4&&osvi.dwMinorVersion == 10)
{
strOSVersion = TEXT("Windows 98");
}
else if (osvi.dwMajorVersion == 4&&osvi.dwMinorVersion == 90)
{
strOSVersion = TEXT("Windows ME");
}
else
{
strOSVersion = TEXT("Windows 95");
}
break;
default:
break;
}
国产CAD/3D
2024-12-03 广告
2024-12-03 广告
我们为企业专业定制的“信创+CAD国产化”的方案,帮助公司进行国产选型可以一步到位解决CAD/3D软件、国产系统、硬件设备等整体适配方案。→点击获取国产CAD企业版优惠方案1. 国产系统需要Linux版本的CAD/3D软件我们提供的国产中望...
点击进入详情页
本回答由国产CAD/3D提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询