我在.NET中一个微不足道的控制台应用程序。这是一个较大的应用程序只是一个测试部分。我想指定我的控制台应用程序的退出code。如何做到这一点?
I have a trivial console application in .NET. It's just a test part of a larger application. I'd like to specify the "exit code" of my console application. How do I do this?
可以从主要归还
如果你声明你的主
方法返回 INT
,或致电Environment.Exit($c$c).
You can return it from Main
if you declare your Main
method to return int
, or call Environment.Exit(code)
.