Hi,
1) you can use WaitForExit and ExitCode to get indication.
2) RedirectStandardOutput and StandardOutput.ReadToEnd should return the
string (I never tried them!)
sample code :
private bool StartAppWithArguments(string args,string FileName)
{
try
{
System.Diagnostics.Process myproc;
myproc = new System.Diagnostics.Process();
myproc.StartInfo.FileName = FileName;
myproc.StartInfo.Arguments = args;
//myproc.StartInfo.RedirectStandardOutput = true;
myproc.StartInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Hidden ;
myproc.EnableRaisingEvents = true;
myproc.Start();
myproc.WaitForExit();
if( myproc.ExitCode == 0)
{
//string strRes = myproc.StandardOutput.ReadToEnd () ;
return true;
}
return false;
}
catch(Exception Err)
{
}
}
Natty Gur[MVP]
blog :
http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!