获取本机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)
  {

Technorati 标签: , ,

  MessageBox.Show(IpEntry.AddressList[i].ToString());
  }
  }

你可能感兴趣的:(IP地址)