IP零碎知识总结

1

(1) 获取本地IP:

string HostName = Dns.GetHostName(); //获取主机名          
IPHostEntry MyEntry = Dns.GetHostByName(Dns.GetHostName()); //获取有关ip信息
IPAddress MyAddress = new IPAddress(MyEntry.AddressList[0].Address);//获取ip

posted @ 2012-05-18 11:51  金河  阅读(240)  评论(0编辑  收藏  举报