D
D
Dmitry2018-03-14 23:06:11
C++ / C#
Dmitry, 2018-03-14 23:06:11

Line feed doesn't work in C# (socket), why?

Good afternoon. There is this code:

string cmd = "admin" + "\n";
byte[] buf = System.Text.ASCIIEncoding.ASCII.GetBytes(cmd.Replace("\0xFF", "\0xFF\0xFF"));
tcpSocket.GetStream().Write(buf, 0, buf.Length);

These are the lines from the telnet client that opens is implemented on sockets. The problem is that the cmd text, line feed character (10) gets into the console, but it does not work. Simply put, do not "press Enter" at the end of the input.
Tried different combinations with \r, no difference....
On the other side of UNIX.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-03-15
@zmitrok62

Here is the library used:
https://www.codeproject.com/Articles/19071/Quick-t...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question