views:

101

answers:

2

How to exit a program with an exit code in C#? In java it would be System.exit(int code);

+8  A: 

Either:

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++.

Tim Robinson
FYI, the docs for the possible return values for Main - http://msdn.microsoft.com/en-us/library/0fwzzxz2.aspx
Richard Szalay
+1 Far better answer than mine was.
fletcher
A: 

Have a look here

digEmAll