开发者

How to exit a program with an exit code: C#

How to exit a program with an开发者_如何学运维 exit code in C#? In java it would be System.exit(int code);


Either:

  • Declare your Main function as returning int, and return a value from it, or
  • Call 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++.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜