//判断操作系统<br>Procedure GetOSInfo(Var SysName,SysVer:String);<br>var<br> osVerInfo : TOSVersionInfo;<br> majorVer, minorVer ,BuildVer: Integer;<br><br>begin<br> SysName := 'Unknown';<br>{ set operating system type flag }<br> osVerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);<br> if GetVersionEx(osVerInfo) then<br> begin<br> majorVer := osVerInfo.dwMajorVersion;<br> minorVer := osVerInfo.dwMinorVersion;<br> BuildVer := osVerInfo.dwBuildNumber ;<br> SysVer :=format('%d.%d build %d',[majorVer,minorVer,BuildVer]);<br> case osVerInfo.dwPlatformId of<br> VER_PLATFORM_WIN32_NT : { Windows NT/2000 }<br> begin<br> if majorVer <= 4 then<br> SysName := 'Windows NT'<br> else<br> if (majorVer = 5) AND (minorVer= 0) then<br> SysName := 'Windows 2000'<br> else<br> if (majorVer = 5) AND (minorVer = 1) then<br> SysName := 'Windows XP'<br> else<br> SysName := 'Unknown';<br> end; {case }<br> VER_PLATFORM_WIN32_WINDOWS : { Windows 9x/ME }<br> begin<br> if (majorVer = 4) AND (minorVer = 0) then<br> SysName := 'Windows 95'<br> else<br> if (majorVer = 4) AND (minorVer = 10) then<br> begin<br> if osVerInfo.szCSDVersion[1] = 'A' then<br> SysName := 'Windows 98 第二版'<br> else<br> SysName := 'Windows 98';<br> end {if Version = 'A'}<br> else<br> if (majorVer = 4) AND (minorVer = 90) then<br> SysName := 'Windows Millenium Edition'<br> else<br> SysName := 'Unknown';<br> end; {case VER_PLATFORM_WIN32_WINDOWS}<br> else<br> SysName := 'Unknown';<br> end;<br> end<br>else<br> SysName := 'Unknown';<br>end;