Exit code from Windows Forms app

后端 未结 3 1154
离开以前
离开以前 2021-02-12 17:46

How do i return a non-zero exit code from a Windows Forms application.

Application.Exit() is the preferred way to exit the application, but there is no exit code argumen

3条回答
  •  一向
    一向 (楼主)
    2021-02-12 18:34

    If your main method returns a value you can return the exit code there. Otherwise you can use Environment.ExitCode to set it.

提交回复
热议问题