method exit program c# code example Example 1: exit programm c# Application.Exit(); Example 2: how to exit a program in c# Application.Exit();