怎样判断当前操作系统是windows200 pro、win2000 server 或win200 adv server(注意,不是问怎样取得操作系统如95、98、2000等)
如题,csdn上查了也没看懂

解决方案 »

  1.   

    程序如何才能识别目前的操作系统环境
    http://www.china-askpro.com/msg1/qa14.shtml
      

  2.   

    我在注册表里搜索advanced server,什么也没找到,估计如果可以的话,只能用api了
      

  3.   

    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 Declare Function GetVersionEx Lib "kernel32.dll" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As LongPrivate Sub Form_Load()
    Dim os As OSVERSIONINFO
    Dim retval As Long
    os.dwOSVersionInfoSize = Len(os)
    retval = GetVersionEx(os)
    MsgBox "Windows version number:" & os.dwMajorVersion & Chr(Asc(".")) & os.dwMinorVersion
    MsgBox "OS Version Info Size = " & os.dwOSVersionInfoSize
    MsgBox "BuildNumber = " & os.dwBuildNumber
    MsgBox "Platform ID = " & os.dwPlatformId
    MsgBox "CSD Version = " & os.szCSDVersion
    End
    End Sub
    看能不能根据版本号得到
      

  4.   

    用WMI也可以
    http://www.mvps.org/vbnet/index.html?code/wmi/wmoperatingsystem.htm
    用obj.Caption这个属性
      

  5.   

    to  likesome(梦龙)
    不行,是怎么不行法?这段代码我试过的,绝对没有问题,你引用
    Microsoft WMI Scripting V 1.2 Library没有
      

  6.   

    用GetVersionEx根据得到的版本号进行判定,要查dwBuildNumber
      

  7.   

    http://www.mvps.org/vbnet/index.html?code/helpers/iswinversion.htm有一个完整的例子,照着做一下