摘要:
private string[] GetLocalIpv4(){//事先不知道ip的个数,数组长度未知,因此用StringCollection储存try{IPAddress[] localIPs;localIPs = Dns.GetHostAddresses(Dns.GetHostName());StringCollection IpCollection = new StringCollection();foreach (IPAddress ip in localIPs){//根据AddressFamily判断是否为ipv4,如果是InterNetWork则为ipv6if (ip.Addres 阅读全文
posted @ 2013-03-27 09:57 快乐的码奴 阅读(241) 评论(0) 推荐(0) 编辑