我目前正在使用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)?