Hi,
I am starting a process and I need to monitor it (wait and check if its
still responding).
But, I it seems that the Process.HasExit ed or Process.Exited doesn't work.
I just need to know if the process is running & responding.
I am using
void somefn(...)
{
if(...)
{
ProcessStartInf o psi = new ProcessStartInf o();
psi.FileName = this.Path;
psi.Arguments = this.CreateArgu ments();
psi.ErrorDialog = false;
psi.UseShellExe cute = true; //tried with false also
Process p = Process.Start(p si);
p.Exited += new EventHandler(Ex ited);
while (p.HasExited)
{
Thread.Sleep(10 00);
}
}
return Success;
}
void Exited(object sender, EventArgs e)
{
MessageBox.Show ("Done");
}
The execution never enters the while loop nor the Exited method is called.
Any ideas???
Regards,
Ashutosh
I am starting a process and I need to monitor it (wait and check if its
still responding).
But, I it seems that the Process.HasExit ed or Process.Exited doesn't work.
I just need to know if the process is running & responding.
I am using
void somefn(...)
{
if(...)
{
ProcessStartInf o psi = new ProcessStartInf o();
psi.FileName = this.Path;
psi.Arguments = this.CreateArgu ments();
psi.ErrorDialog = false;
psi.UseShellExe cute = true; //tried with false also
Process p = Process.Start(p si);
p.Exited += new EventHandler(Ex ited);
while (p.HasExited)
{
Thread.Sleep(10 00);
}
}
return Success;
}
void Exited(object sender, EventArgs e)
{
MessageBox.Show ("Done");
}
The execution never enters the while loop nor the Exited method is called.
Any ideas???
Regards,
Ashutosh
Comment