判断Windows OS 版本类型的方法在线教程
№1.声明外部函数:
Function uLong GetVersionExA( Ref str_osversioninfo lpVersionInfo ) Library "kernel32.dll"
№2.声明结构体:
$PBExportHeader$str_osversioninfo.srs
global type str_osversioninfo from structure
ulong dwOSVersionInfoSize
ulong dwmajorversion
ulong dwminorversion
ulong dwbuildnumber
ulong dwplatformid
character szcsdverion[128]
end type
№3.把当前系统的OS类型取出放入st_3中。
str_OsVersionInfo lstr_VersionInfo
lstr_VersionInfo.dwosversioninfosize = 148
GetVersionExA( lstr_VersionInfo )
choose case lstr_versionInfo.dwmajorversion
case 3
if lstr_VersionInfo.dwminorversion = 51 then
sle_3.text="WINNT 3.51"
end if
case 4
choose case lstr_VersionInfo.dwminorversion
case 10
sle_3.text="WINDOWS98"
case 90
sle_3.text="WINDOWS ME"
case 0
sle_3.text="WINNT 4 OR WINDOWS95"
end choose
case 5
choose case lstr_VersionInfo.dwminorversion
case 0
sle_3.text="WINDOWS2000"
case 1
sle_3.text="WINDOWS XP"
case 2
sle_3.text=”WINDOWS 2003”
end choose
end choose