摘要: C#如何获取本机网络ip有几种方法获取本机局域网地址和网络地址。1. 获取本机局域网地址:使用IPHostEntry2. 获取本机网络ip地址通过向网站http://www.ip138.com/ip2city.asp发送webrequest,分析返回的数据流 try { string strUrl = "http://www.ip138.com/ip2city.asp"; //获得IP的网址 Uri uri = new Uri(strUrl); WebRequest webreq = WebRequest.Create(uri); Stream s = webreq .Ge 阅读全文
posted @ 2012-07-20 23:00 孤獨龍 阅读(821) 评论(0) 推荐(0)