Sending ctrl + c to telnet app in C#

  • Thread starter Thread starter mule
  • Start date Start date
M

mule

hello all, I have a c# app that telnets into a router and issues a
series of commands. All works great except I haven't figured out how to
send a CTRL+C. I need this so I can kill a program that tends to get
hung.

Thanks!
 
seems like you are doing a busy wait rather creating threads on the
connection. If you are not able to communicate with server then you should
be able to terminate thread by closing connection between client and server.
Ctrl+C is a shortcut for program to terminate (forceful kill) the
application as DOS is single threaded.
 
Well the program that I'm telnetting to has been known to get hung,
even outside of a programmatic telnet session. So I'm really just
looking for a way to send a "break"
 
Back
Top