title: Async process start and wait for it to finish
body: <p>I am new to the thread model in .NET. What would you use to:</p>
  <ol>
  <li>Start a process that handles a file <code>(process.StartInfo.FileName = fileName;)</code>.</li>
  <li>Wait for the user to close the process OR abandon the thread after some time.</li>
  <li>If the user closed the process, delete the file.</li>
  </ol>
  <p>Starting the process and waiting should be done on a different thread than the main thread, because this operation should not affect the application.</p>
  <p>Example:</p>
  <p>My application produces an html report. The user can right click somewhere and say &quot;View Report&quot; - now I retrieve the report contents in a temporary file and launch the process that handles html files i.e. the default browser. The problem is that I cannot cleanup, i.e. delete the temp file.</p>