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.Thread
s.
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?
精彩评论