还有如何得出网络状态(IP,DNS,MASK..)
DOS 命令IPCONFIG就可以,但在VB中怎么得出?谢谢各位拉!!

解决方案 »

  1.   

    Option ExplicitPublic Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As LongPublic Type OSVERSIONINFO
            dwOSVersionInfoSize As Long
            dwMajorVersion As Long
            dwMinorVersion As Long
            dwBuildNumber As Long
            dwPlatformId As Long
            szCSDVersion As String * 128      '  Maintenance string for PSS usage
    End TypePublic Type OSVersion
        osvOSName As Long                       '操作系统类型
        osvOSVerMajor As Long                   '主版本号
        osvOSVerMinor As Long                   '次版本号
        osvOSVerRevision As Long                '修正号
    End TypePublic Const gc_lngPlatformID_Win3X As Long = 0
    Public Const gc_lngPlatformID_Win9X As Long = 1
    Public Const gc_lngPlatformID_WinNT As Long = 2Public Function GetOSVersion() As OSVersion
        
    '获取操作系统的名称及版本
        
        Dim OSInfo As OSVERSIONINFO
        
        OSInfo.dwOSVersionInfoSize = Len(OSInfo)
        Call GetVersionEx(OSInfo)
        
        With GetOSVersion
            .osvOSName = OSInfo.dwPlatformId
            .osvOSVerMajor = OSInfo.dwMajorVersion
            .osvOSVerMinor = OSInfo.dwMinorVersion
            .osvOSVerRevision = OSInfo.dwBuildNumber
        End With
        
    End Function
      

  2.   

    Windows 2000 是        NT 5.0
    Windows XP   是        NT 5.1
    Windows Server 2003 是 NT 5.2
      

  3.   

    谢谢 tenner
    我已在components找到控件-SYSINFO
    其属性就有osplatform, osversion,osbuild,所以在FORM中放入这个控件就可以了.
    但你给我的程序对我搞其他东西有很好帮助.谢谢拉.
    另外,我只找到查IP的控件,无法查到SUB MASK,和DNS SERVER IP, 你有建议吗?还有如何给你20分?