close console application when i stop execution code example
Example 1: c# exit console
static void Main()
{
//do stuff
Environment.Exit(1);// exit
}
Example 2: how to exit application c# console
System.Environment.Exit(0);
// or
Environment.Exit(0);