简体   繁体   English

如何使用退出代码退出程序:C#

[英]How to exit a program with an exit code: C#

How to exit a program with an exit code in C#? 如何使用C#中的退出代码退出程序? In java it would be System.exit(int code); 在java中它将是System.exit(int code);

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++. Main返回一个值比在方法中间退出该过程要好一些,但这可能与适用于Java,C或C ++的建议相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM