怎么把多主机的网站一次解析出所有IP?
上边的图是某软件的图,能解析出百度的两个主机IP,请问用VB如何实现?解析百度的域名要出现下边的结果
www.baidu.com >> 202.108.22.5  202.108.22.43
这个是C++的代码,不知道行不行,可以看看:http://iask.sina.com.cn/b/9989448.htm
可以的话翻译成VB的代码

解决方案 »

  1.   

    贴图方法
    http://topic.csdn.net/u/20090623/15/83fd893b-1ca1-42aa-932f-d7abb284a55e.html?seed=1346207492&r=57911518#r_57911518
      

  2.   

    那个图看不见也没关系,知道www.baidu.com能解析两个IP就行,图没用
      

  3.   

    可以再命令行中输入 nslookup www.baidu.com 可以得出所有IP,怎么保存?
    s1=第一个IP
    s2=第二个IP
    s3=第三个IP
    …………
    以此类推
      

  4.   

    nslookup www.baidu.com>>c:\1.txt
      

  5.   

    Option ExplicitPrivate Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)Sub Main()
        Dim a() As String
        Dim i As Long
        
        Shell "cmd.exe /c nslookup www.baidu.com > C:\temp\1.txt"
        Sleep 1000
        
        a = GetAddress("C:\temp\1.txt", "www.baidu.com")
        For i = 0 To UBound(a)
            Debug.Print Trim$(a(i))
        Next
    End SubFunction GetAddress(ByVal FileName As String, ByVal Name As String) As String()
        Dim hFile As Integer
        Dim sLine As String
        Dim a() As String
        Dim sAddress As String
        
        hFile = FreeFile()
        Open FileName For Input Access Read As #hFile
        While Not EOF(hFile)
            Line Input #hFile, sLine
            If InStr(1, sLine, ":") Then
                a = Split(sLine, ":")
                If a(0) = "Addresses" Then
                    GetAddress = Split(a(1), ",")
                    GoTo Finish
                End If
            End If
        Wend
    Finish:
        Close #hFile
    End Function