识别操作系统版本

'引用控件 Microsoft SysInfo Control 6.0
Dim OS As String

With SysInfo1
    Select Case .OSPlatform
        Case 0: OS = "Win32"
        Case 1:
            Select Case .OSVersion
                Case 4: OS = "Win 95"
                Case 4.1: OS = "Win 98"
                Case 4.9: OS = "Wim Me"
            End Select
        Case 2:
            Select Case .OSVersion
                Case 4: OS = "Win NT"
                Case 5: OS = "Win 2000"
                Case 6: OS = "Win XP"
            End Select
    End Select
    
    MsgBox "Build:" & .OSBuild & vbNewLine & _
        "Platform:" & OS & "(" & .OSPlatform & ")" & vbNewLine & _
        "Version:" & .OSVersion
End With

 

posted @ 2014-04-03 13:53  Spacecup  阅读(252)  评论(0编辑  收藏  举报