[英]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: 或者:
Main
function as returning int
, and return a value from it, or Main
函数声明为返回int
,并从中返回一个值,或 Environment.Exit(int)
Environment.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++. 从
Main
返回一个值比在方法中间退出该过程要好一些,但这可能与适用于Java,C或C ++的建议相同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.