以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]怎么获取当前计算机的IP地址  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=50973)

--  作者:aduydgd
--  发布时间:2014/5/16 8:53:00
--  [求助]怎么获取当前计算机的IP地址
怎么获取当前计算机的IP地址,内网和外网
--  作者:Bin
--  发布时间:2014/5/16 8:57:00
--  
Dim IPAdress As System.Net.IPAddress 
dim HostName as string
HostName = System.Net.Dns.GetHostName \'获得本机的机器名 
IPAdress = System.Net.Dns.GetHostByName(HostName).AddressList.GetValue(0) \'获得本机的IP 
OutPut.Show( HostName )  \'本机机器名 
OutPut.Show(IPAdress.ToString )  \'本机的IP