本帖最后由 feifei20080 于 2011-04-28 11:33:16 编辑

解决方案 »

  1.   

    Public Function GetoutIp() As String
       Dim txt As String, GetOutIp1 As String
       txt = GetHTML("http://www.cz88.net/ip/viewip468.aspx")
       GetOutIp1 = Mid(txt, InStr(txt, "IPMessage") + 11, 11)
       GetoutIp = Left(GetOutIp1, 12) & Format(Val(Mid(GetOutIp1, 13, 3)), "###")
    End Function
    只获取了IP,如果我想获取他的名称该如何改
      

  2.   

    你看看这个行不行 我也不懂
    http://blog.zdnet.com.cn/html/83/289383-1069851.html
      

  3.   

    Dim o As Object, conten As String
    Dim pos1 As Integer, pos2 As IntegerSet o = CreateObject("Microsoft.XMLHTTP")
    o.open "get", "http://www.ip138.com/ip2city.asp", False
    o.send
    If o.ReadyState = 4 Then
        Content = StrConv(o.responsebody, vbUnicode)
    End If
        pos1 = InStr(1, Content, "<center>")
        pos2 = InStr(pos1, Content, "</center>")
    If pos1 > 0 And pos2 > 0 Then    localip2 = Mid(Content, pos1 + 17, pos2 - 19 - pos1)
        Label7.Caption = localip2 & "(本机)" '本地外网IP显示
        If Text1.Text = "" Then Text1.Text = localip2
    Else
        MsgBox "IP地址获取失败"
    End If