1.使用SessionEnding事件

参考MSDN

2.在需要处理 关机事件中可以注册SessionEnding事件

App.Current.SessionEnding += Current_SessionEnding;
        private void Current_SessionEnding(object sender, SessionEndingCancelEventArgs e)
        {
             
             //处理一些事情
            DoExit();
             
        }

 

相关文章:

  • 2021-06-01
  • 2022-12-23
  • 2021-08-23
  • 2021-12-14
  • 2021-10-26
  • 2021-06-16
  • 2022-03-01
  • 2021-09-13
猜你喜欢
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
相关资源
相似解决方案