//捕获Ctrl+C事件 Console.CancelKeyPress += Console_CancelKeyPress; //进程退出事件 AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; //卸载事件 AssemblyLoadContext.Default.Unloading += Default_Unloading;