I'm trying to connect and send command to a TCP server (I think it's Telnet). All I know is I need to send commands to receive data.
We already have a reader on our local network, but it's very old and does not have all the functions we need. To monitor the reader, I installed Wireshark. Where it showed that the command sent is in plain text. And there's no authentication.
So I just need to connect, without authentication and send the command in plain text. How to connect to a Telnet server using C #?
Wireshark print: print
this is an example for Sockets, which is one way of sending and receiving data by TCP. You can change adress and port, and request text, and it should already be a working example.
Socket Class (System.Net.Socket)
If the thing you need to send are bytes instead of text, you can fill the sent byte array manually instead of decoding a string into a byte array in the line
Byte[] bytesSent = Encoding.ASCII.GetBytes(request);