static void Main(string[] args) { AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit); } static void OnProcessExit(object sender, EventArgs e) { Console.WriteLine("Exit"); Console.Read(); }
static void Main(string[] args) { AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit); } static void OnProcessExit(object sender, EventArgs e) { Console.WriteLine("Exit"); Console.Read(); }