Search code examples
c#tcpport-scanning

c# tcp port scanner resources


Does anyone knows of any .Net library or resources that will assist me to implement a TCP port scanner?


Solution

  • For simple one, that will just try to connect to each port and report success / failure, without any "tricks", like sending only ACK packets etc. - you won't need anything else than System.Net and System.Net.Sockets, create socket, try connecting to a host, check if you have succeeded. For better performance, you can create more sockets, and use asynchronous approach (BeginConnect/EndConnect).