473,768 Members | 7,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!

Dec 7 '05 #1
3 3138

"mule" <tj**********@g mail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
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.


http://www.ietf.org/rfc/rfc0854.txt

David
Dec 8 '05 #2
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**********@g mail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
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!

Dec 8 '05 #3
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"

Dec 8 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
14000
by: Scott | last post by:
I am using a TCPIP connection to communicate over port 23 (telnet) to a server, and I am having to mimic normal command line interface you owuld see in a telnet session (i.e. I have to write to this socket just like you would enter things on the keyboard if you telneted to this server). In a normal telnet session you can enter some commands which take a long time to complete, and they run in the background and you get the command line...
4
5199
by: praba kar | last post by:
Dear All, Normally we can send mail using telnet in linux. In the following way telnet Ipaddress 25 mail from: raj@rajkumar.com 250 o.k(response of from commandline) rcpt to: test@oops.co.in 250 o.k(response of from commandline) data 354 go ahead(response of from commandline)
2
6270
by: Zach Flynn | last post by:
Ok, so I'm programming in Unix if that makes any difference. And I'm doing: system("telnet somehost.com 25"); But I can't figure out how to send a command to it. Like, for example, I would like to send the helo command to the smpt port with this telnet open. Does anyone here know how to? Thanks. (kinda desired output)
2
2263
by: barry | last post by:
The code below is in a button but though there is no error message of any kind I am not getting the email which I am sending to myself. Any help would be appreciated. System.Web.Mail.SmtpMail.SmtpServer = "127.0.0.1" System.Web.Mail.SmtpMail.Send(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text)
3
11415
by: s99999999s2003 | last post by:
hi i have a program that works very similar to tail -f in Unix It will need a Ctrl-C in order to break out of the program. I wish to run this program using python (either thru os.system() or some other subprocess modules) and how can i pass Ctrl-C to this program to terminate it in python? thanks
3
9736
by: Daniel Clark | last post by:
I have a Windows command line based application that only shuts down cleanly if it sees "CTRL-C" on the console. I need to automate the running of this application, but still allow the user sitting at the machine to cancel the process cleanly if he/she needs to. In Unix this would be a tiny shell script that used "kill -15", but under Windows there does not seem to be an easy way to do this, at least that I can find. Below is a test...
0
1864
by: ranishobha21 | last post by:
Dear All, I am sending the code below.i have not specifies the host name.i want to send command to server and get the response from it.but it doesnt work.when i connect with the telnet using ssh to remote machine it works. i type telnet hostname->username->password and then i can login to the
5
3123
by: sui | last post by:
this is my code import sys, os, glob, datetime, time import smtplib ## Parameters for SMTP session port=587 SMTPserver= 'smtp.gmail.com' SMTPuser= '...@gmail.com' pw= 'fill in here' SENDER= SMTPuser
0
4848
by: Graycon | last post by:
I am trying to reboot several devices on my private network through telnet. I wrote a vbs that does the operation but i cannot select any other window while it is running of the input will not go into the telnet window created. I have begun to convert the code to C++ and am having problems I can get telnet to open to the ip address that I want but do not know how to pass any commands to it. I have read about 30 different website and people...
0
10017
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9961
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9843
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8840
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6656
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5283
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3932
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3534
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.