开发者

Get a List of all listening servers on a port on the LAN in C#

开发者 https://www.devze.com 2023-02-10 05:00 出处:网络
Suppose I want to check see which hosts are listening for a connection on a specific port on the local area netw开发者_运维百科ork, How would this be accomplished in C#. The reason i want this is so t

Suppose I want to check see which hosts are listening for a connection on a specific port on the local area netw开发者_运维百科ork, How would this be accomplished in C#. The reason i want this is so that I can connect to a server thats listening on the LAN by specifying the host name.


You mean a portscan, but one where it scans a subnet for 1 single port? Ok, what you need is System.Net.Sockets.TcpClient and 64 or so System.Threading.Threads.


possible only with connection orianted protocols like TCP.

why not just iterate the computers in the network trying taking a socket and trying to connect to the port you are probing?

0

精彩评论

暂无评论...
验证码 换一张
取 消