各位大哥帮我急啊,我现在是用adsl上网的,我想用程序取得我的外网的当时的ip怎么搞啊,需要什么函数啊,什么的,最好能给我个例子,谢谢大家啊

解决方案 »

  1.   

    新建工程-〉飲用winsocket空間
    然後寫代碼
    Private Sub Form_Load()
    MsgBox Me.Winsock1.LocalIP
    End Sub
      

  2.   

    zyg0大哥说的我不是没用过,可是哪个只能得到本地的ip啊,我的是局域网,我要的是外网的ip啊
      

  3.   

    我给你一个dll可以得到 外网的IP 我自己做的,你到我网站上留言,我把下载地址贴到回复上 你自己下载吧。海梅网络
    http://fzwang.com
      

  4.   

    于C:\下建立如下批处理文件 IP.BAT
    IPconfig > c:\$IP.Tmp
    c盘下会得到如下的文本文件$IP.Tmp 内容
    Windows IP Configuration   Ethernet adapter 本地连接:          Connection-specific DNS Suffix  . :          IP Address. . . . . . . . . . . . : 189.30.20.110         Subnet Mask . . . . . . . . . . . : 255.255.0.0         Default Gateway . . . . . . . . . : 189.30.0.1  PPP adapter 中国网通:          Connection-specific DNS Suffix  . :          IP Address. . . . . . . . . . . . : 218.68.28.151         Subnet Mask . . . . . . . . . . . : 255.255.255.255         Default Gateway . . . . . . . . . : 218.68.28.151 
    再后边不用教了吧
      

  5.   

    向你提供两种方法:
    1、向某些提供此类服务的服务器发送请求,然后分析返回的数据;
    2、读注册表。现在一般的ADSL都是虚拟拨号的方式,拨号后会在注册表中存有获得的外网IP。
      

  6.   

    用这个网址:http://asp5.6to23.com/fishrimp/dns/getip.asp
      

  7.   

    1、用API取得IP地址表
    Private Declare Function GetIpAddrTable Lib "IPHlpApi.dll" (pIPAdrTable As Byte, pdwSize As Long, ByVal Sort As Long) As Long
    2、从表中分析出外网IP。不过GetIpAddrTable在Win98下好像不能用。