|
2#
楼主 |
发表于 2015-3-21 16:05:33
|
只看该作者
- If .wServicePackMajor > 0 Then
- GetWindowsVersion = GetWindowsVersion & " Service Pack " & .wServicePackMajor & IIf(.wServicePackMinor >0, "." & .wServicePackMinor, vbNullString)
- End If
- ElseIf .dwPlatformId = VER_PLATFORM_WIN32_NT And .dwMajorVersion = 6 Then
- Select Case .dwMinorVersion
- Case 0
- Select Case .wProductType
- Case PRODUCT_BUSINESS
- GetWindowsVersion = "Business Edition"
- Case PRODUCT_BUSINESS_N
- GetWindowsVersion = "Business Edition (N)"
- Case PRODUCT_CLUSTER_SERVER
- GetWindowsVersion = "Cluster Server Edition"
- Case PRODUCT_DATACENTER_SERVER
- GetWindowsVersion = "Server Datacenter Edition (full installation)"
- Case PRODUCT_DATACENTER_SERVER_CORE
- GetWindowsVersion = "Server Datacenter Edition (core installation)"
- Case PRODUCT_ENTERPRISE
- GetWindowsVersion = "Enterprise Edition"
- Case PRODUCT_ENTERPRISE_N
- GetWindowsVersion = "Enterprise Edition (N)"
- Case PRODUCT_ENTERPRISE_SERVER
- GetWindowsVersion = "Server Enterprise Edition (full installation)"
- Case PRODUCT_ENTERPRISE_SERVER_CORE
- GetWindowsVersion = "Server Enterprise Edition (core installation)"
- Case PRODUCT_ENTERPRISE_SERVER_IA64
- GetWindowsVersion = "Server Enterprise Edition for Itanium-based Systems"
- Case PRODUCT_HOME_BASIC
- GetWindowsVersion = "Home Basic Edition"
- Case PRODUCT_HOME_BASIC_N
- GetWindowsVersion = "Home Basic Edition (N)"
- Case PRODUCT_HOME_PREMIUM
- GetWindowsVersion = "Home Premium Edition"
- Case PRODUCT_HOME_PREMIUM_N
- GetWindowsVersion = "Home Premium Edition (N)"
- Case PRODUCT_HOME_SERVER
- GetWindowsVersion = "Home Server Edition"
- Case PRODUCT_SERVER_FOR_SMALLBUSINESS
- GetWindowsVersion = "Server for Small Business Edition"
- Case PRODUCT_SMALLBUSINESS_SERVER
- GetWindowsVersion = "Small Business Server"
- Case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM
- GetWindowsVersion = "Small Business Server Premium Edition"
- Case PRODUCT_STANDARD_SERVER
- GetWindowsVersion = "Server Standard Edition (full installation)"
- Case PRODUCT_STANDARD_SERVER_CORE
- GetWindowsVersion = "Server Standard Edition (core installation)"
- Case PRODUCT_STARTER
- GetWindowsVersion = "Starter Edition"
- Case PRODUCT_STORAGE_ENTERPRISE_SERVER
- GetWindowsVersion = "Storage Server Enterprise Edition"
- Case PRODUCT_STORAGE_EXPRESS_SERVER
- GetWindowsVersion = "Storage Server Express Edition"
- Case PRODUCT_STORAGE_STANDARD_SERVER
- GetWindowsVersion = "Storage Server Standard Edition"
- Case PRODUCT_STORAGE_WORKGROUP_SERVER
- GetWindowsVersion = "Storage Server Workgroup Edition"
- Case PRODUCT_ULTIMATE
- GetWindowsVersion = "Ultimate Edition"
- Case PRODUCT_ULTIMATE_N
- GetWindowsVersion = "Ultimate Edition (N)"
- Case PRODUCT_UNDEFINED
- GetWindowsVersion = "An unknown product"
- Case PRODUCT_UNLICENSED
- GetWindowsVersion = "Not activated product"
- Case PRODUCT_WEB_SERVER
- GetWindowsVersion = "Web Server Edition"
- End Select
-
- Select Case .wProductType
- Case 1 ' Win Vista
- GetWindowsVersion = "Windows Vista " & GetWindowsVersion
- Case 3 ' Win Server 2008
- GetWindowsVersion = "Windows Server 2008 " & GetWindowsVersion
- Case Else
- GetWindowsVersion = "Windows Vista " & GetWindowsVersion
- End Select
-
- If .wServicePackMajor > 0 Then
- GetWindowsVersion = GetWindowsVersion & " Service Pack " & .wServicePackMajor &IIf(.wServicePackMinor > 0, "." & .wServicePackMinor, vbNullString)
- End If
-
- End Select
- End If
- GetWindowsVersion = GetWindowsVersion & " [Version: " & .dwMajorVersion & "." & .dwMinorVersion & "." &.dwBuildNumber & "]"
- End With
- End Function
复制代码
|
|