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 argument.
I know about Environment.Exit(), but that is not a nice way to close the application loop….
Application.Exitjust force the call toApplication.Run(That is typically inprogram.cs) to finish. so you could have :and still inside your application call
Application.Exitto close it.Small sample