Search code examples
c#.nettelnet

How to write c# console app that behave like the telnet command on cmd windows?


I want to programmatically sending (and processing the response) message. Instead of open cmd and type in the command manually:

  1. connecting to the server by using command telnet [server_address] [port_number]
  2. send a message
  3. processing the response and send a following message
  4. repeat step 3 ...

How can I achieve this by using c#?


Solution

  • Telnet library url: http://www.codeproject.com/KB/IP/MinimalisticTelnet.aspx

    Previous thread: Executing commands by using Telnet in C#

    Cheers.