// In a console application:
Environment.Exit(0);
// In a WPF application:
Close();
System.Environment.Exit(1);
private void Test(int condition)
{
if(condition)
return; // Exit the methode
// Here code if condition == false
}
Application.Exit();
System.Windows.Forms.Application.ExitThread( )