怎么自动检测到当前windows的语言版本?windows2000?

解决方案 »

  1.   

    (copy from somewhere):Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
    Private Type OSVERSIONINFO
        dwOSVersionInfoSize As Long
        dwMajorVersion As Long
        dwMinorVersion As Long
        dwBuildNumber As Long
        dwPlatformId As Long
        szCSDVersion As String * 128
    End Type
    Private Sub Form_Load()
        Dim OSInfo As OSVERSIONINFO, PId As String
        'KPD-Team 1998
        'URL: http://www.allapi.net/
        '[email protected]
        'Set the graphical mode to persistent
        Me.AutoRedraw = True
        'Set the structure size
        OSInfo.dwOSVersionInfoSize = Len(OSInfo)
        'Get the Windows version
        Ret& = GetVersionEx(OSInfo)
        'Chack for errors
        If Ret& = 0 Then MsgBox "Error Getting Version Information": Exit Sub
        'Print the information to the form
        Select Case OSInfo.dwPlatformId
            Case 0
                PId = "Windows 32s "
            Case 1
                PId = "Windows 95/98"
            Case 2
                PId = "Windows NT "
        End Select
        Print "OS: " + PId
        Print "Win version:" + str$(OSInfo.dwMajorVersion) + "." + LTrim(str(OSInfo.dwMinorVersion))
        Print "Build: " + str(OSInfo.dwBuildNumber)
    End Sub
      

  2.   

    '引用控件 Microsoft SysInfo Control 6.0
    Dim OS As StringWith 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
      

  3.   

    来个简单的
    加载SysInfo控件
    Private Sub Form_Load()
            
            Select Case SysInfo.OSPlatform
                    Case 0
                            lstInfo.AddItem "OS Platform = Unknown 32-Bit Windows"
                    Case 1
                            lstInfo.AddItem "OS Platform = Windows 95"
                    Case 2
                            lstInfo.AddItem "OS Platform = Windows NT"
            End Select
            lstInfo.AddItem "OSVersion = " & SysInfo.OSVersion
            lstInfo.AddItem "OSBuild = " & SysInfo.OSBuildEnd Sub