I create a process which run my application with
parameters, but when I run the application I can't see the
output untill the proccess finisting to run the
application.
How can I see the out put during the running ?
p = new System.Diagnostics.Process();
string arg ="App.exe" ;
stringparameter = "9";
p.EnableRaisingEvents =true;
p.Exited += new System.EventHandler(this.p_Exited);
System.Diagnostics.ProcessStartInfo psI;
psI = new Diagnostics.ProcessStartInfo(arg,parameter);
psI.FileName=arg;
psI.UseShellExecute = false;
psI.RedirectStandardInput = true;
psI.RedirectStandardOutput = true;
psI.RedirectStandardError = true;
psI.CreateNoWindow = true;
p.StartInfo = psI;
int timout =(int)
p.Start();
if (!p.WaitForExit(timout))
{
if(p!=null)
{
p.Close();
p.Kill();
}
}
string s ="" ;
s = p.StandardOutput.ReadToEnd();