471,315 Members | 1,467 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,315 software developers and data experts.

Quastion about Process in C#

i am starting an exe and want to find out in runtime when that exe end!
Is there a way to wait after start process until it end ?
// MY CODE:

string currentPfxPass ="MyPass"
string pfxDir =@"C:\MypfxFile.pfx";

ProcessStartInfo startInfo = new ProcessStartInfo("ImportPFX.exe");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments =" " +pfxDir+ " "+currentPfxPass;
Process.Start(startInfo);

thank you

Saleh Matani
Dec 1 '05 #1
3 1763

"Saleh Matani" <sa***@matani.net> wrote in message
news:eY*************@TK2MSFTNGP12.phx.gbl...
i am starting an exe and want to find out in runtime when that exe end!
Is there a way to wait after start process until it end ?
// MY CODE:

string currentPfxPass ="MyPass"
string pfxDir =@"C:\MypfxFile.pfx";

ProcessStartInfo startInfo = new ProcessStartInfo("ImportPFX.exe");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments =" " +pfxDir+ " "+currentPfxPass;
Process.Start(startInfo);

thank you

Saleh Matani


Take a look at the WaitForExit member of the process class,

Simon
Dec 1 '05 #2
Simon Watson wrote:
"Saleh Matani" <sa***@matani.net> wrote in message
news:eY*************@TK2MSFTNGP12.phx.gbl...
i am starting an exe and want to find out in runtime when that exe end!
Is there a way to wait after start process until it end ?
// MY CODE:

string currentPfxPass ="MyPass"
string pfxDir =@"C:\MypfxFile.pfx";

ProcessStartInfo startInfo = new ProcessStartInfo("ImportPFX.exe");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments =" " +pfxDir+ " "+currentPfxPass;
Process.Start(startInfo);

thank you

Saleh Matani

Take a look at the WaitForExit member of the process class,

Simon

thank you Simon ;)
Dec 1 '05 #3
Hi
You can also get error and state information back from you app.

yourProcess.StartInfo.RedirectStandardOutput = true;
yourProcess.StartInfo.RedirectStandardError = true;

and read it into a stream :- yourProcess.StandardOutput.ReadToEnd()

see:-
http://msdn.microsoft.com/library/de...utputtopic.asp

Hope this helps...

Dec 1 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Sean | last post: by
reply views Thread by Justin Johnson | last post: by
1 post views Thread by Peter Åstrand | last post: by
11 posts views Thread by Mike M | last post: by
10 posts views Thread by Sorin Dolha [MCSD .NET] | last post: by
4 posts views Thread by =?Utf-8?B?U3Jhag==?= | last post: by

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.