首页 > 代码库 > 获取本地计算机的操作系统
获取本地计算机的操作系统
OSVERSIONINFO os; os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&os); CString strOS; if(os.dwPlatformId == 0) { strOS = "Win32"; } else if(os.dwPlatformId == 1) { if(os.dwMinorVersion == 0) strOS = "Windows 95 "; else if(os.dwMinorVersion == 10) strOS = "Windows 98 "; strOS += os.szCSDVersion; } else if(os.dwPlatformId == 2) { if(os.dwMajorVersion ==3) { strOS = "Windows NT 3.51"; } else if(os.dwMajorVersion == 4) { strOS = "Windows NT 4.0"; } else if(os.dwMajorVersion == 5) { if(os.dwMinorVersion == 0) strOS = "Windows 2000 "; else if(os.dwMinorVersion == 1) strOS = "Windows XP "; else if(os.dwMinorVersion == 2) strOS = "Windows Server 2003 "; } else if(os.dwMajorVersion == 6) { if(os.dwMinorVersion == 0) strOS = "Windows Vista "; else if(os.dwMinorVersion == 1) strOS = "Windows 7 "; } strOS += os.szCSDVersion; } m_strVersion = strOS;
获取本地计算机的操作系统
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。