// In a console application:
Environment.Exit(0);
// In a WPF application:
Close();
if (System.Windows.Forms.Application.MessageLoop)
{
// WinForms app
System.Windows.Forms.Application.Exit();
}
else
{
// Console app
System.Environment.Exit(1);
}
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( )