跟踪窗口关闭 [英] Track window close
本文介绍了跟踪窗口关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何跟踪最终用户直接关闭浏览器的时间.
我想知道他/她通过alt + f4或关闭按钮或通过任务栏等关闭窗口时的注销时间.
请发送给我这个问题的解决方案...
I want to know how to track when the browser directly close by end user.
I want to know his/her log out time when window close by alt+f4 or close button or close by the task bar etc.
Please send me the solution of this problem...
推荐答案
我恐怕没有统一的方法来解决这个问题.
浏览器的窗口关闭事件 [
I''m afraid, there is no consistent way to do this.
Window Close Event of Browser[^] discusses some approaches, but again, different browsers may have different results on the close events.
假设您正在谈论自己的应用程序的窗口关闭,可以通过以下方式完成:
Assuming that you are talking about the window close of your own application this can be done by:
Application.ApplicationExit += new EventHandler(Application_ApplicationExit);
但是,如果您正在谈论操作系统中正在运行的任何其他应用,那么您可以使用以下类的方法来监视所需的窗口是否正在打开或关闭(因为这也会启动或停止相关进程)
But if you are talking about any other appllication running in OS then perhaps u can use some method of following class to monitor the required windows is being opened or closed (as that will start or stop the related process too)
System.Diagnostics.Process
这篇关于跟踪窗口关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文