c# command to exit program code example Example: c# program exit System.Windows.Forms.Application.ExitThread( )