When should one use Environment.Exit to terminate a console application?

前端 未结 7 1360
长发绾君心
长发绾君心 2020-12-03 06:58

I\'m maintaining a number of console applications at work and one thing I\'ve been noticing in a number of them is that they call Environment.Exit(0).

A sample progr

7条回答
  •  时光取名叫无心
    2020-12-03 07:14

    This is really used when other applications are waiting on the result of your console app. For example, SSRS (tool) can launch a console app, and waits to get back a success of failure response. The Environment.Exit(0) sends back a successful execution message.

提交回复
热议问题