.NET|.NET 获取当前主机IP列表

string _ComputName = System.Net.Dns.GetHostName();
System.Net.IPAddress[] _IPList = System.Net.Dns.GetHostAddresses(_ComputName);
for (int i = 0; i != _IPList.Length; i++)
{
if (_IPList[i].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
{
MessageBox.Show(_IPList[i].ToString());
}
【.NET|.NET 获取当前主机IP列表】}

    推荐阅读