C#/.NET获取本机的IP地址


System.Net.IPHostEntry ips = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); foreach (System.Net.IPAddress ip in ips.AddressList) { Console.WriteLine(ip.ToString()); }

 

posted @ 2015-10-16 14:02  JaneAi  阅读(524)  评论(0编辑  收藏  举报