C# 得到本机局域网IP地址
C#获取本机IP搜集整理7种方法:http://blog.csdn.net/frombegintoend/article/details/7713097
使用IPHostEntry获取本机局域网地址 string hostName = Dns.GetHostName(); IPHostEntry localHost = Dns.GetHostEntry(hostName); for (int i=0; i < localHost.AddressList.Length ; ++i) { if (localHost.AddressList[i].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) { Console.WriteLine(localHost.AddressList[i].ToString()); } }