问题描述
背景:
启动时,我有一些依赖SQL的服务,但是关闭时,Microsoft并没有撤消该过程.
I have services that depend on SQL when starting up, but Microsoft doesn't reverse the process when shutting down, I know, amazing.
因此,直到Vista,我使用WinLogon注册表项编写了一个dll以获取Windows通知,因此当关闭事件触发时,在服务收到关闭事件之前,我将有更多时间关闭服务.这有助于在SQL崩溃之前关闭我的服务.
So, until Vista, I wrote a dll using the WinLogon registry entry to get Windows Notifications so when the shutdown event fired I would have additional time to shutdown my services before the services received the shutdown event. Which helped in getting my services shutdown before SQL went down.
因此,大街上的新词是使用ICredentialProvider接口,但是我找不到任何有关在文档中获取关闭事件的信息,而且我也没有对.NET的了解!新的文档指出,您只能编写服务,很遗憾,我已经在这样做了.
So, new word on the street is use ICredentialProvider Interface, but I can't find anything about getting a shutdown event in the documentation, plus no hook for .NET, I know!! And the new documentation states that you can just write a service, unfortunately, I'm already doing that.
有人知道解决方案吗?
Anybody know of a solution? Any help greatly appreciated !!
推荐答案
这篇关于如何在没有Windows通知的情况下捕获Vista中的关机事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!