exit function c# code example
Example 1: c# how to exit program
System.Environment.Exit(1);
Example 2: exit a method c#
private void Test(int condition)
{
if(condition)
return; // Exit the methode
// Here code if condition == false
}
Example 3: c# program exit
System.Windows.Forms.Application.ExitThread( )