获取本机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 标签: C#,IP,IP地址

  MessageBox.Show(IpEntry.AddressList[i].ToString());
  }
  }
posted @ 2010-12-05 21:08  黑色草莓  阅读(385)  评论(0编辑  收藏  举报