c# how to exit application code example
Example 1: how to exit application c# console
System.Environment.Exit(0);
// or
Environment.Exit(0);
Example 2: how to exit a program in c#
Application.Exit();
System.Environment.Exit(0);
// or
Environment.Exit(0);
Application.Exit();