Process

  • Thread starter Thread starter Crispie
  • Start date Start date
C

Crispie

Hello,
I start freepdf as a process in my C# program.
The Problem is, that this is done in a while-clause and cause of this,
I have running a lot of freepdf-Processes at the same time. I would
like to change this, so that the next Process is waiting until the
running one ends.

The code:

foreach(FileInfo file in dirInfo.GetFiles("*.ps")) {
ProcessStartInfo proc = new ProcessStartInfo();
proc.FileName = freePDFPath;
proc.Arguments = "...";
Process.Start(proc);
}
 
Take a look at a property called HasExited or an event called Exited.

Either one of these members give you the opportunity to wait until the
running process has exited.

Hope this helps!

Yosh
 
Forgot to mention a Method called WaitForExit.

Yosh said:
Take a look at a property called HasExited or an event called Exited.

Either one of these members give you the opportunity to wait until the
running process has exited.

Hope this helps!

Yosh
 
Back
Top