【发布时间】:2013-06-27 03:37:24
【问题描述】:
我正在尝试以http://checkip.dyndns.org/ 返回的方式获取网络 IP 地址。
但我从以下代码中得到了这个结果。
fe80::28d3:b8e8:caab:63b3%10
我想要互联网点整数格式的 ip 地址 lilke 122.168.149.143
foreach (IPAddress ipa in Dns.GetHostAddresses(Dns.GetHostName()))
{
if (ipa.AddressFamily == AddressFamily.InterNetwork)
{
textBox2.Text = ipa.ToString();
break;
}
}
【问题讨论】:
标签: c# ip-address ipv6