从申请退出推迟 [英] postponing from the exit of the application

查看:88
本文介绍了从申请退出推迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我已经创建了一个vb.net应用程序,它将连续24 * 7运行.当某些任务在我的应用程序中运行时,无法关闭该应用程序,我该如何在Form.Closing事件中的vb.net

hi all i have created a vb.net application,it will run continusly 24*7. the application cannot be closed when certain task is running in my application,how shall i do this in vb.net

推荐答案

中执行此操作(假设这是Windows Forms应用程序),可以使用Process类查看其他进程是否仍在运行.

您可能希望每隔几秒钟轮询一次此检查,因为您不想取消正在关闭的应用程序,可能会阻止Windows关闭.
In the Form.Closing event (assuming this is a Windows Forms app) of your application you can use the Process class to see if your other process is still running.

You would probably want to poll every few seconds to do this check as you don''t want to cancel the app being closed, possibly stopping Windows from shutting down.


这篇关于从申请退出推迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆