简体   繁体   中英

telnet session sending 'F3' key to TcpClient using network stream

i am making telnet session using c# and wanna to send 'F3' to the session

TcpClient oClient = new TcpClient();
oClient.Connect(IP, 23);  
NetworkStream ns = oClient.GetStream();
string msg=""// here to send 'F3' key
ns.Write(msg, 0, msg.Length);

i tried "{F3}" and "\\033[13~" but didn't work

The underlying data here is just a TCP stream that has no concept of a keyboard, so the real question is: what does the other end expect to that it is interpreting as F3 ? One way to do this would be to set up a dummy TCP dump console exe (server) and have a working client connect and press F3 - inspect what was sent. However, there are some likely candidates, including:

  • "^[[13~"
  • "\\033[13~"
  • "\\x1bOR"

(for different client/server implementations)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM