How to exit a program with an exit code in C#?
In java it would be System.exit(int code);
Either:
Main
function as returning int
, and return a value from it, orEnvironment.Exit(int)
Returning a value from Main
is a little nicer than exiting the process in the middle of a method, but this is presumably the same advice that applies to Java, C or C++.
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