【发布时间】:2020-09-23 03:47:52
【问题描述】:
在此代码中仅查找系统 IP 地址和系统名称,我想查找网络上可用的所有 IP 地址和名称。
String StringHost;
StringHost = System.Net.Dns.GetHostName();
IPHostEntry ipEntry =System.Net.Dns.GetHostEntry(StringHost);
IPAddress[] address = ipEntry.AddressList;
for (int i = 1; i < address.Length; i++)
{
IP_Address_Datagridview.Rows.Add();
IP_Address_Datagridview.Rows[i].Cells[0].Value = StringHost;
IP_Address_Datagridview.Rows[i].Cells[1].Value = address[i].ToString();
}
【问题讨论】:
-
您的意思是要查找网络上的其他计算机?
-
“我想查找网络上所有可用的 IP 地址和名称”是什么意思。 ?
-
Angry IP Scanner 是我在 pass 中用于此类搜索的实用程序。 Github 上有可用的源代码,可能会对您有所帮助:angryip.org
-
你可以使用
nmap,例如,看看它的输出
标签: c# .net networking ip-address