how to close console application in c# with code code example Example: how to exit application c# console System.Environment.Exit(0); // or Environment.Exit(0);