.net core 程序退出事件

平滑关闭,关闭事件


//捕获Ctrl+C事件
Console.CancelKeyPress += Console_CancelKeyPress;

//进程退出事件
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;

//卸载事件
AssemblyLoadContext.Default.Unloading += Default_Unloading;

猜你喜欢

转载自www.cnblogs.com/kellynic/p/9727363.html