Guaranteed process termination

by alski 14. March 2005 15:44

Got a FATAL code and don't know if it will be handled in a service or an application, but you need a guaranteed way to abort [Beware: Its not pretty]

I recommend you only ever use this if you are running inside exception handling code, which would otherwise keep everything running, if at all!

//Now lets commit Hari-Kiri
Process.GetCurrentProcess().Kill();

Update: DotNet 2.0 has the XXX function to do exactly the same. And that's not good code either

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

RecentComments

Comment RSS