Application can't be closed.

B

Boki

Hi All,

When I start a Process, ex:

System.Diagnostics.Process.Start("http://www.yahoo.com");

The application can't be closed correctly.
//// FAILED CODE BEGIN///////
{
MessageBox.Show("Out of date", "Boki
Software");
System.Diagnostics.Process.Start("http://
www.yahoo.com");
this.Close();
}
//// FAILED CODE END ///////

if I removed the process line, it works as my expectation.
//// WORKS CODE BEGIN///////
{
MessageBox.Show("Out of date", "Boki
Software");
this.Close();
}
//// WORKS CODE END///////

Best regards,
Boki.
 
J

Jon Skeet [C# MVP]

When I start a Process, ex:

System.Diagnostics.Process.Start("http://www.yahoo.com");

The application can't be closed correctly.

You've said that it fails, but you haven't given any indication of the
nature of the failure. My guess is that an exception is being thrown
by Process.Start, so your Close() call is never executed - but without
enough information, it really is just a guess.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top