how to exit a function in c# code example
Example 1: c# exit console
static void Main()
{
//do stuff
Environment.Exit(1);// exit
}
Example 2: c# how to exit program
System.Environment.Exit(1);
static void Main()
{
//do stuff
Environment.Exit(1);// exit
}
System.Environment.Exit(1);