How to detect a Kill Process event

前端 未结 2 1550
无人共我
无人共我 2020-12-20 04:52

In C# i using process.Kill() kill a process, at the same time in killed application how to detect this event?

BTW: Application.ApplicationExit event has not been fir

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-20 05:36

    if it's a winform, you can capture the event FormClosing and check the CloseReason:

    None
    WindowsShutDown
    MdiFormClosing
    UserClosing
    TaskManagerClosing
    FormOwnerClosing
    ApplicationExitCall
    

提交回复
热议问题