Sending ctrl + c to telnet app in C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mule

    Sending ctrl + c to telnet app in C#

    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!

  • David Browne

    #2
    Re: Sending ctrl + c to telnet app in C#


    "mule" <tj.muehleman@g mail.com> wrote in message
    news:1133998649 .589596.195440@ z14g2000cwz.goo glegroups.com.. .[color=blue]
    > 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.[/color]



    David


    Comment

    • Pohihihi

      #3
      Re: Sending ctrl + c to telnet app in C#

      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.


      "mule" <tj.muehleman@g mail.com> wrote in message
      news:1133998649 .589596.195440@ z14g2000cwz.goo glegroups.com.. .[color=blue]
      > 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!
      >[/color]


      Comment

      • mule

        #4
        Re: Sending ctrl + c to telnet app in C#

        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"

        Comment

        Working...