正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!
您需要 登录 才可以下载或查看,没有账号?立即注册
x
判断系统版本号有很多种方式: 1、用SYSINFO结构体获取
- if ((SYSINFO.nWinMajor == 6 ) && (SYSINFO.nWinMinor >= 0)) then
- MessageBox ("The system is more than XP.", SEVERE);
- else
- MessageBox ("The system is Window XP and before.", SEVERE);
- endif;
复制代码2、通过查询注册表来判断系统: - NUMBER nOS,nvResult;
- STRING svOS;
- nOS = REGDB_NUMBER;
- RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
- RegDBGetKeyValueEx( "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","CurrentVersion", nOS, svOS, nvResult);
- if (svOS == "6.0") then
- MessageBox("We are on Vista!", INFORMATION);
- else
- if (svOS == "5.1") then
- MessageBox("We are on XP!",INFORMATION);
- endif;
- endif;
复制代码
还有一种方法是调用 GetSystemInfo函数,具体函数用法参见help文档。
Operating system | Version number | dwMajor Version | dwMinor Version | Other | Windows 7 | 6.1 | 6 | 1 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION | Windows Server 2008 R2 | 6.1 | 6 | 1 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION | Windows Server 2008 | 6.0 | 6 | 0 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION | Windows Vista | 6.0 | 6 | 0 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION | Windows Server 2003 R2 | 5.2 | 5 | 2 | GetSystemMetrics(SM_SERVERR2) != 0 | Windows Server 2003 | 5.2 | 5 | 2 | GetSystemMetrics(SM_SERVERR2) == 0 | Windows XP | 5.1 | 5 | 1 | Not applicable | Windows 2000 | 5.0 | 5 | 0 | Not applicable |
Operating system | Version number | dwMajor Version | dwMinor Version | Other | Windows 7 | 6.1 | 6 | 1 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION | Windows Server 2008 R2 | 6.1 | 6 | 1 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION | Windows Server 2008 | 6.0 | 6 | 0 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION | Windows Vista | 6.0 | 6 | 0 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION | Windows Server 2003 R2 | 5.2 | 5 | 2 | GetSystemMetrics(SM_SERVERR2) != 0 | Windows Server 2003 | 5.2 | 5 | 2 | GetSystemMetrics(SM_SERVERR2) == 0 | Windows XP | 5.1 | 5 | 1 | Not applicable | Windows 2000 | 5.0 | 5 | 0 | Not applicable |
|