C#取本机ip地址
IPAddress[] hostipspool = Dns.GetHostAddresses(“”);
//使用以下语句则可以循环读取出本机的每一个IP地址信息:
string hostperip;
for (int i = 0; i < hostipspool.Length; i++)
{
hostperip = hostipspool.ToString();
MessageBox.Show(hostperip);
}
Popularity: 5% [?]
学技术适可而止,除非走技术路线。计算机技术这条路不好走。我的工程师证书睡觉了