System.Net.IPHostEntry ips = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); foreach (System.Net.IPAddress ip in ips.AddressList) { Console.WriteLine(ip.ToString()); }
System.Net.IPHostEntry ips = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); foreach (System.Net.IPAddress ip in ips.AddressList) { Console.WriteLine(ip.ToString()); }
转载于:https://www.cnblogs.com/janeaiai/p/4885133.html