无法启动服务,因为它已被禁用或者没有与之关联的已启用设备 [英] service cannot be started because it is disabled or because it has no enabled devices associated with it

查看:874
本文介绍了无法启动服务,因为它已被禁用或者没有与之关联的已启用设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写以下代码以安装Windows更新。但是我收到错误无法启动服务。(GetHotaloryCount()中的例外情况来自HRESULT:0x80070422)。这段代码在Windows 7中运行良好,但现在在xp中出现这个错误



这是我的代码

I am writing the following code to get windows updates installed. But I am getting error "The service cannot be started, either. (Exception from HRESULT: 0x80070422)" in GetTotalHistoryCount(). this code worked well in windows 7 but now gving this error in xp

this is my code

var updateSession = new UpdateSession();
var updateSearcher = updateSession.CreateUpdateSearcher();
var count = updateSearcher.GetTotalHistoryCount();
var history = updateSearcher.QueryHistory(0, count);
for (int i = 0; i < count; ++i)
    ls.Add(history[i].Title);



谢谢

swati


thanks
swati

推荐答案

dfgdsgf
sdfgs


这篇关于无法启动服务,因为它已被禁用或者没有与之关联的已启用设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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