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
Go to event tab in your form and in click place double click on it and then in code place write Environment.Exit(0);
Environment.Exit(0);