how to close console application in c# 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);
Example 3: c# how to terminate console application
System.Envrionment.Exit(0);
//or
Envrionment.Exit(0);
Example 4: c# how to exit program
System.Environment.Exit(1);
Example 5: c# how to close application
Environment.Exit(0);