What is the C# equivalence for System.exit(0);
?
Thanks
What Does C Programming Language (C) Mean? C is a high-level and general-purpose programming language that is ideal for developing firmware or portable applications. Originally intended for writing system software, C was developed at Bell Labs by Dennis Ritchie for the Unix Operating System in the early 1970s.
C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With