I want to communicate with a Telnet server using C# in .NET Framework 4.6.2. I just simply want to send a command and get its response. I have already tried using Socket programming and Telnet library. In both cases, I am receiving the command as well as the response in the output. That is if I send the command Status
and its response from the telnet server is Online
in output I get Status\r\rOnline\r\n
.
Also, one more problem I am facing with the Telnet library is that it provides async methods and I am restricted to programming in synchronous methods by the underlying SDK I am using.
So, I would like to know if there is a straightforward way to communicate with the telnet server using C# in .NET Framework 4.6.2.