What is the C# equivalence for System.exit(0);
?
Thanks
If you are using a Console Application -
Environment.Exit(exitCode);
Else if you are using a Windows Forms based application -
Application.Exit();
Courtesy: http://www.dreamincode.net/forums/topic/273503-java-systemexit0%3B-equivalent-in-c%23/
You can use Environment.Exit(0)
instead. Note that this is somewhat more complicated than Java due to some permissions issues, but in general this is the symmetrical equivalent.
You can read more about the possible Exceptions thrown in the linked documentation.