获得操作系统版本

osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx (&osvi);
 
typedef struct _OSVERSIONINFOEX {
DWORD dwOSVersionInfoSize;
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
TCHAR dwPlatformId;
TCHAR szCSDVersion[128];
WORD wServicePackMajor; //wServicePackMajor; //sp
WORD wServicePackMinor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wProductType;
BYTE wReserved; } OSVERSIONINFOEX,
*POSVERSIONINFOEX,
*LPOSVERSIONINFOEX;
dwMajorVersion
Major version number of the operating system. This member can be one of the following values.
ValueMeaning
4 Windows NT 4.0
5 Windows Server 2003, Windows XP, or Windows 2000
dwMinorVersion
Minor version number of the operating system. This member can be one of the following values.
ValueMeaning
0 Windows 2000 or Windows NT 4.0
1 Windows XP
2 Windows Server 2003
posted @ 2007-03-21 14:15  ahuo  阅读(362)  评论(0编辑  收藏  举报