终止服务 [英] Terminating a service
本文介绍了终止服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果服务需要自行关闭,比如由于在程序中检测到致命错误,那么最干净的方法是什么?我可以简单地使用
Visual Basic End语句吗?
我的流程中只运行一项服务。
谢谢!
If a service needs to shut itself down, say due to a fatal error detected in
the program, what is the cleanest way to do that? Can I simply use the
Visual Basic End statement?
I only have a single service running in my process.
Thanks!
推荐答案
您至少应首先尝试处理任何相关对象。
OHM
Lee Schipper写道:
you should at least try and dispose of any relevant objects first.
OHM
Lee Schipper wrote:
如果服务需要自行关闭,请说是由于致命错误<在程序中检测到,最干净的方法是什么?我可以简单地使用Visual Basic End语句吗?
我的流程中只运行一个服务。
谢谢!
If a service needs to shut itself down, say due to a fatal error
detected in the program, what is the cleanest way to do that? Can I
simply use the Visual Basic End statement?
I only have a single service running in my process.
Thanks!
>
-
最诚挚的问候 - OHM
O_H_M {at} BTInternet {dot} com
--
Best Regards - OHM
O_H_M{at}BTInternet{dot}com
你好OHT,
忙吗?
:-))
Cor
Hi OHT,
Busy?
:-))
Cor
OHM写道:< snip>你应该至少尝试处理任何相关的物品
first< snip>
是的。我会尝试做我在OnStop()中所做的所有事情。
然而,End的突然出现了我,我不确定系统是否
想要正式通知其中一项服务即将消失。
Lee
OHM wrote: <snip>you should at least try and dispose of any relevant objects
first<snip>
Yep. I would try to do all the same stuff that I do in my OnStop().
However the abruptness of the End bugged me and I wasn''t sure if the system
would want to be formally notified that one of its services was going away.
Lee
这篇关于终止服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文