how to close c# console application code example
Example 1: how to exit application c# console
System.Environment.Exit(0);
// or
Environment.Exit(0);
Example 2: c# how to terminate console application
System.Envrionment.Exit(0);
//or
Envrionment.Exit(0);
Example 3: how to exit a program in c#
Application.Exit();
Example 4: how to close a form c#
this.Close();