how to exit a console application in c# with a prompt code example
Example 1: c# exit console
static void Main()
{
//do stuff
Environment.Exit(1);// exit
}
Example 2: c# exit application
// In a console application:
Environment.Exit(0);
// In a WPF application:
Close();