To exit a c# program simply use following command:
Status is the integer you return to tell the environment how your program concludes. If it executed according as expected or if it encountered any errors.
The commonly used success value is zero 0 This will mean that your program termintaes without any problems so Windows or any other environment (or a caller) will know your code has performed without a problem.
And the commonly used failure code is negative one -1