exit console in c# code example
Example 1: c# exit console
static void Main()
{
//do stuff
Environment.Exit(1);// exit
}
Example 2: c# how to terminate console application
System.Envrionment.Exit(0);
//or
Envrionment.Exit(0);
Example 3: c# exit console
Environment.Exit(0);