获取本机IP地址
System.Net.IPHostEntry IpEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());
for (int i = 0; i != IpEntry.AddressList.Length; i++)
{
if (!IpEntry.AddressList[i].IsIPv6LinkLocal)
{
MessageBox.Show(IpEntry.AddressList[i].ToString());
}
}