C++的:<br> OSVERSIONINFO ver;<br> ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);<br> GetVersionEx(&ver);<br> switch(ver.dwPlatformId)<br> {<br> case VER_PLATFORM_WIN32s:<br> MessageBox(Handle,("Your PlatForm is : /nWindows3.x " + IntToStr(ver.dwMajorVersion) + "." + IntToStr(ver.dwMinorVersion) + "/nBuild : " + IntToStr(ver.dwBuildNumber) + "/n This Software Can't Run in Win3.x !").c_str(),"自动登录",MB_OK+MB_ICONINFORMATION);<br> return;<br> case VER_PLATFORM_WIN32_WINDOWS:<br> strRegPath = "//SOFTWARE//Microsoft//Windows//CurrentVersion//Winlogon";<br> MessageBox(Handle,("Your PlatForm is : /nWindows9x " + IntToStr(ver.dwMajorVersion) + "." + IntToStr(ver.dwMinorVersion) + "/nBuild : " + IntToStr(ver.dwBuildNumber)).c_str(),"自动登录",MB_OK+MB_ICONINFORMATION);<br> break;<br> case VER_PLATFORM_WIN32_NT:<br> strRegPath = "//SOFTWARE//Microsoft//Windows NT//CurrentVersion//Winlogon";<br> MessageBox(Handle,("Your PlatForm is : /nWindowsNT " + IntToStr(ver.dwMajorVersion) + "." + IntToStr(ver.dwMinorVersion) + "/nBuild : " + IntToStr(ver.dwBuildNumber)).c_str(),"自动登录",MB_OK+MB_ICONINFORMATION);<br> }