close application programmatically c# code example Example: c# how to close application Environment.Exit(0);