Andre S. Veteran Posted December 7, 2010 Veteran Share Posted December 7, 2010 I need my C# application to suicide, brutally. Don't ask why. I can't just go find the process bearing its name in the list of processes because there could be several of them and I wouldn't know which one is "self". Link to comment https://www.neowin.net/forum/topic/958854-c-have-process-kill-itself/ Share on other sites More sharing options...
0 nub Posted December 7, 2010 Share Posted December 7, 2010 http://msdn.microsoft.com/en-us/library/system.environment.exit.aspx Yes? Link to comment https://www.neowin.net/forum/topic/958854-c-have-process-kill-itself/#findComment-593465414 Share on other sites More sharing options...
0 Mr. Gibs Posted December 7, 2010 Share Posted December 7, 2010 http://msdn.microsoft.com/en-us/library/system.diagnostics.process.kill.aspx Quick google search lol. Link to comment https://www.neowin.net/forum/topic/958854-c-have-process-kill-itself/#findComment-593465416 Share on other sites More sharing options...
0 Andre S. Veteran Posted December 7, 2010 Author Veteran Share Posted December 7, 2010 (edited) Yeah I found it by myself 2 minutes after posting here. Really needed this urgently, sorry. Process.GetCurrentProcess().Kill(); // AAARGHHHGHglglgghh... Link to comment https://www.neowin.net/forum/topic/958854-c-have-process-kill-itself/#findComment-593465432 Share on other sites More sharing options...
0 Mr. Gibs Posted December 7, 2010 Share Posted December 7, 2010 On 07/12/2010 at 04:33, Dr_Asik said: Yeah I found it by myself 2 minutes after posting here. Really needed this urgently, sorry. Process.GetCurrentProcess().Kill(); // AAARGHHHGHglglgghh... Haha. You sure are learning a lot of languages in one go lol Link to comment https://www.neowin.net/forum/topic/958854-c-have-process-kill-itself/#findComment-593465442 Share on other sites More sharing options...
0 Andre S. Veteran Posted December 7, 2010 Author Veteran Share Posted December 7, 2010 On 07/12/2010 at 04:36, /- Razorfold said: Haha. You sure are learning a lot of languages in one go lol Actually I've been doing a bit of C# now and then for 2 years now. I just happened to have a deadline in 5 minutes and I wasn't finding what I wanted on Google right away and I was going mad. It's over now. I breathe. :) Link to comment https://www.neowin.net/forum/topic/958854-c-have-process-kill-itself/#findComment-593465616 Share on other sites More sharing options...
0 garethevans1986 Posted December 7, 2010 Share Posted December 7, 2010 Environment.Exit(-1); Link to comment https://www.neowin.net/forum/topic/958854-c-have-process-kill-itself/#findComment-593466072 Share on other sites More sharing options...
Question
Andre S. Veteran
I need my C# application to suicide, brutally. Don't ask why. I can't just go find the process bearing its name in the list of processes because there could be several of them and I wouldn't know which one is "self".
Link to comment
https://www.neowin.net/forum/topic/958854-c-have-process-kill-itself/Share on other sites
6 answers to this question
Recommended Posts