Application.Exit

  • Thread starter Thread starter Karin
  • Start date Start date
K

Karin

Are there any situations when you cannot use Application.Exit?
I have a class Error with a static function LogError and a static counter
Errors. If more than 10 errors occur during 1 minute I want to shut down the
program but Application.Exit() doesn't do the job.
Any ideas?

Thanks!
/K
 
Karin said:
Are there any situations when you cannot use Application.Exit?
I have a class Error with a static function LogError and a static counter
Errors. If more than 10 errors occur during 1 minute I want to shut down the
program but Application.Exit() doesn't do the job.
Any ideas?


Close()
?


C.
 
Are there any situations when you cannot use Application.Exit?
I have a class Error with a static function LogError and a static
counter Errors. If more than 10 errors occur during 1 minute I want to
shut down the program but Application.Exit() doesn't do the job.
Any ideas?

Thanks!
/K

System.Diagnostics.Process.GetCurrentProcess().Kill();

This is the most radical immediate shutdown you can have.
Although you should always try a gracefull closure first. Like Closing all
Forms, stopping all foreground Threads.
 
Hi,
How do I get hold of the form from my class?

/K

Pass a reference to that Form to the class when instantiating it.

if you are directly in a form just call this.Close();
 
Back
Top