我目前正在C#中使用一個小聊天工具。
問題是我無法弄清楚如何掃描所有機器上的特定端口的網絡。我目前使用這種方法如何掃描等待網絡連接的端口
IPGlobalProperties network = IPGlobalProperties.GetIPGlobalProperties();
IEnumerable<IPEndPoint> connections = network.GetActiveTcpListeners()
.Where(x => x.Port == ConstParams.iPort);
其中ConstParams.iPort
是我想要掃描(6910這裏)端口。
的問題是,返回的值是唯一的本地端口和「0.0.0.0」的IP地址......
我如何可以掃描當前網絡上的所有開放端口(6910)?
展望如何* NMAP *作品可以幫助你描述。 – 2012-05-16 18:46:01