c# how to quit application code example
Example 1: c# exit application
// In a console application:
Environment.Exit(0);
// In a WPF application:
Close();
Example 2: how to close an application in c#
this.Close();
//This only close the current form or window that you are using.
Example 3: c# program exit
System.Windows.Forms.Application.ExitThread( )