Re: c# - detecting when external program exits from console app
- From: Mohammed Adeel <licenced2chill@xxxxxxxxxxx>
- To: programmingblind@xxxxxxxxxxxxx
- Date: Thu, 31 Jan 2008 17:13:33 +0000 (GMT)
I'm expecting the uT2K4Process_Exited method to be called when the external
program shuts down. Instead nothing happens when the external program exits. No
error messages. The uT2K4Process_Exited method is not activated.
Adeel
Date: Wed, 30 Jan 2008 20:40:53 -0500 (EST)
From: Jamal Mazrui <
empower@xxxxxxxxx>
Subject: Re: c# - Detecting external process shut down from console
application
Perhaps I missed it, what are you expecting to happen, what is
happening
instead, and what error message, if any, are you getting?
Jamal
On Thu, 31 Jan
2008, Mohammed Adeel wrote:
> Date: Thu, 31 Jan 2008 00:30:27 +0000 (GMT)
> From: Mohammed Adeel <
licenced2chill@xxxxxxxxxxx>
> Reply-To:
programmingblind@xxxxxxxxxxxxx
> To:
programmingblind@xxxxxxxxxxxxx
> Subject: c# - Detecting external process shut down from console
> application
>
> Hi,
> I've got a console application written in C#.
> I'm launching an external program from my application which is
working fine but I'd like to be able to detect when the program I've started
shuts down.
> This is the code I've got. i've put it in the main method of the
app:
> Process UT2K4 = new Process();
> UT2K4.StartInfo.FileName = "c:\\ut2004\\system\\ut2004.exe";
> UT2K4.StartInfo.Arguments = "-mod=AudioUT2K4";
> UT2K4.Exited += new EventHandler( app.uT2K4Process_Exited);
> UT2K4.Start();
> and this is the method for the exit handler:
> private void uT2K4Process_Exited(object sender, EventArgs e) {
> Console.WriteLine ("ut2k4 shutdown");
> Log.Write("user exited TTS server");
> TTS.Speak("exiting", true);
> }
>
---------------------------------
Yahoo! Answers - Get better answers from someone who knows. Tryit now.
- Follow-Ups:
- SSH editor for Windows.
- From: Darragh
Other related posts:
- » Re: c# - detecting when external program exits from console app
- » RE: c# - detecting when external program exits from console app
- SSH editor for Windows.
- From: Darragh