console application return error message c#\ code example
Example 1: c# exit console
static void Main()
{
//do stuff
Environment.Exit(1);// exit
}
Example 2: c# exit console
Environment.Exit(0);
static void Main()
{
//do stuff
Environment.Exit(1);// exit
}
Environment.Exit(0);