|
发表于 2020-3-21 11:17:58
|
显示全部楼层
广东省惠州市
@项目部004
- .版本 2
- .子程序 系统_取系统版本, 文本型, 公开, 支持获取win98、win2000 、winXP、win2003 、win2008 、win7 、win8 、win2012、win8.1 、win10 系统版本。
- .参数 参_主版本, , 参考 可空, 变量储存返回值
- .参数 参_次版本, , 参考 可空, 变量储存返回值
- .参数 参_是否带名称, 逻辑型, 可空, 是否带版本名称描述,如 专业版,企业版等
- .参数 参_是否取位数, 逻辑型, 可空, 操作系统位数,如32位或64位
- .参数 参_取SP版本号, 逻辑型, 可空
- .参数 参_取内部版本, 逻辑型, 可空, build内部版本
- .局部变量 m_osvi, OSVERSIONINFOEX
- .局部变量 m_si, SYSTEM_INFO
- .局部变量 m_dwType
- .局部变量 m_system, 文本型
- .局部变量 m_version, 文本型
- .局部变量 m_dwMajorVersion, 整数型
- .局部变量 m_dwMinorVersion, 整数型
- .局部变量 m_dwBuildNumber, 短整数型
- .局部变量 m_retrun, 文本型
- .局部变量 m_isWOW64, 逻辑型
- .局部变量 m_szCSDVersion, 文本型
- .局部变量 m_CurrentBuild, 文本型
- .局部变量 m_strMark, 文本型
- m_osvi.dwOSVersionInfoSize = 156
- .如果真 (GetVersionEx (m_osvi))
- GetSystemInfo (m_si)
- IsWow64Process (-1, m_isWOW64)
- RtlGetNtVersionNumbers (m_osvi.dwMajorVersion, m_osvi.dwMinorVersion, m_dwBuildNumber)
- 参_主版本 = m_osvi.dwMajorVersion
- 参_次版本 = m_osvi.dwMinorVersion
- m_osvi.dwBuildNumber = m_dwBuildNumber
- .判断开始 (m_osvi.dwMajorVersion = 10)
- .判断开始 (m_osvi.dwMinorVersion = 0)
- ' m_system = 选择 (m_osvi.wProductType = #VER_NT_WORKSTATION, “Windows 10”, “Windows Server 2016”)
- .如果 (m_osvi.wProductType = #VER_NT_WORKSTATION)
- m_system = “Windows 10”
- .否则
- m_system = 取文本zc项 (#本地机器, “SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName”, )
- .如果结束
- .默认
- .判断结束
- .判断 (m_osvi.dwMajorVersion = 6)
- .判断开始 (m_osvi.dwMinorVersion = 0)
- m_system = 选择 (m_osvi.wProductType = #VER_NT_WORKSTATION, “Windows Vista”, “Windows Server 2008”)
- .判断 (m_osvi.dwMinorVersion = 1)
- m_system = 选择 (m_osvi.wProductType = #VER_NT_WORKSTATION, “Windows 7”, “Windows Server 2008 R2”)
- .判断 (m_osvi.dwMinorVersion = 2)
- m_system = 选择 (m_osvi.wProductType = #VER_NT_WORKSTATION, “Windows 8”, “Windows Server 2012”)
- .判断 (m_osvi.dwMinorVersion = 3)
- m_system = 选择 (m_osvi.wProductType = #VER_NT_WORKSTATION, “Windows 8.1”, “Windows Server 2012 R2”)
- .默认
- .判断结束
- .判断 (m_osvi.dwMajorVersion = 5 且 m_osvi.dwMinorVersion = 0)
- m_system = “Windows 2000”
- .如果 (m_osvi.wProductType = 1)
- m_version = “Professional”
- .否则
- .如果真 (位与 (m_osvi.wSuiteMask, 128) = 0)
- m_version = “Datacenter Server”
- .如果真结束
- .如果 (位与 (m_osvi.wSuiteMask, 2) = 0)
- m_version = “Advanced Server”
- .否则
- m_version = “Server”
- .如果结束
- .如果结束
- .判断 (m_osvi.dwMajorVersion = 5 且 m_osvi.dwMinorVersion = 1)
- m_system = “Windows XP”
- .如果 (位与 (m_osvi.wSuiteMask, 512) = 1)
- m_version = “Home Edition” ' “家庭版”
- .否则
- m_version = “Professional” ' “专业版”
- .如果结束
- .判断 (m_osvi.dwMajorVersion = 5 且 m_osvi.dwMinorVersion = 2)
- .判断开始 (GetSystemMetrics (89) ≠ 0)
- m_system = “Windows Server 2003 R2, ”
- .判断 (位与 (m_osvi.wSuiteMask, 8192) = 8192)
- m_system = “Windows Storage Server 2003”
- .判断 (位与 (m_osvi.wSuiteMask, 32768) = 32768)
- m_system = “Windows Home Server”
- .判断 (m_osvi.wProductType = 1 且 m_si.wProcessorArchitecture = 9)
- m_system = “Windows XP Professional x64 Edition” ' Xp专业版64位系统
- .默认
- m_system = “Windows Server 2003, ”
- .判断结束
- .判断 (m_osvi.dwMajorVersion = 4 且 m_osvi.dwMinorVersion = 10)
- m_system = “Windows 98”
- .默认
- .判断结束
- .如果真 (m_osvi.dwMajorVersion ≥ 6)
- RtlGetProductInfo (m_osvi.dwMajorVersion, m_osvi.dwMinorVersion, 0, 0, m_dwType)
- .判断开始 (m_dwType = 1) ' 旗舰版
- m_version = “Ultimate Edition”
- .判断 (m_dwType = 2) ' 家庭普通版
- m_version = “Home Basic Edition”
- .判断 (m_dwType = 3) ' 家庭高级版
- m_version = “Home Premium Edition”
- .判断 (m_dwType = 4) ' 企业版
- m_version = “Enterprise Edition”
- .判断 (m_dwType = 6) ' 商业版
- m_version = “Business Edition”
- .判断 (m_dwType = 7) ' 服务器标准版
- m_version = “Standard”
- .判断 (m_dwType = 8) ' 服务器企业版
- m_version = “Datacenter Edition”
- .判断 (m_dwType = 9) ' 小型服务器
- m_version = “Small Business Server”
- .判断 (m_dwType = 10) ' 服务器企业版(完整的安装)
- m_version = “Enterprise Edition”
- .判断 (m_dwType = 11) ' 入门版
- m_version = “Starter Edition”
- .判断 (m_dwType = 12) ' 服务器xx中心版(核心安装)
- m_version = “Datacenter Edition (core installation)”
- .判断 (m_dwType = 13) ' 服务器标准版(核心安装)
- m_version = “Standard Edition (core installation)”
- .判断 (m_dwType = 14) ' 服务器企业版(核心安装)
- m_version = “Enterprise Edition (core installation)”
- .判断 (m_dwType = 15) ' 一个企业级的平台
- m_version = “Enterprise Edition for Itanium-based Systems”
- .判断 (m_dwType = 16) ' 商用公司版
- m_version = “Business N”
- .判断 (m_dwType = 17) ' Web服务器(完整安装)
- m_version = “Web Server (full installation)”
- .判断 (m_dwType = 18) ' 服务器群集版
- m_version = “HPC Edition”
- .判断 (m_dwType = 19) ' 2008 R2 储存服务器版
- m_version = “Windows Storage Server 2008 R2 Essentials”
- .判断 (m_dwType = 20) ' 服务器快速储存版
- m_version = “Storage Server Express”
- .判断 (m_dwType = 21) ' 服务器标准储存版
- m_version = “Storage Server Standard”
- .判断 (m_dwType = 22) ' 服务器储存组
- m_version = “Storage Server Workgroup”
- .判断 (m_dwType = 23) ' 服务器储存企业版
- m_version = “Storage Server Enterprise”
- .判断 (m_dwType = 25)
- m_version = “Small Business Server Premium Edition”
- .判断 (m_dwType = 48) ' 专业版
- m_version = “Professional”
- .默认
- m_system = “获取失败,请检查版本:” + 到文本 (m_osvi.dwMajorVersion) + “.” + 到文本 (m_osvi.dwMinorVersion)
- .判断结束
- .如果真结束
- m_retrun = m_system
- m_retrun = 选择 (参_是否带名称, m_retrun + “ ” + 选择 (寻找文本 (m_retrun, m_version, , 假) = -1, m_version, “”), m_retrun)
- m_retrun = 选择 (参_是否取位数, 选择 (m_isWOW64, m_retrun + “ x64”, m_retrun + “ x86”), m_retrun)
- .如果真 (参_取SP版本号)
- m_szCSDVersion = 到文本 (m_osvi.szCSDVersion)
- .如果真 (取文本长度 (m_szCSDVersion) = 0)
- m_szCSDVersion = 取文本zc项 (#本地机器, “SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion”, )
- .如果真结束
- m_strMark = 选择 (取文本长度 (m_szCSDVersion) > 2, m_szCSDVersion, “”)
- .如果真结束
- .如果真 (参_取内部版本)
- .如果 (m_osvi.dwBuildNumber = 0)
- m_CurrentBuild = 取文本zc项 (#本地机器, “SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuild”, )
- .否则
- m_CurrentBuild = 到文本 (m_osvi.dwBuildNumber)
- .如果结束
- .如果 (m_strMark ≠ “”)
- m_strMark = m_strMark + “,Build:” + m_CurrentBuild
- .否则
- m_strMark = “Build:” + m_CurrentBuild
- .如果结束
- .如果真结束
- .如果真 (m_strMark ≠ “”)
- m_strMark = “ (” + m_strMark + “)”
- .如果真结束
- 返回 (m_retrun + m_strMark)
- .如果真结束
- 返回 (“”)
复制代码 |
评分
-
查看全部评分
|