c# how to exit program

C#
System.Environment.Exit(1);
Source

Also in C#: