Windows Update
来源:互联网 发布:北交大知行 编辑:程序博客网 时间:2024/06/05 14:35
6down voteaccepted
Add a Reference to WUApiLib to your C# project.
using WUApiLib;protected override void OnLoad(EventArgs e){ base.OnLoad(e); UpdateSession uSession = new UpdateSession(); IUpdateSearcher uSearcher = uSession.CreateUpdateSearcher(); uSearcher.Online = false; try { ISearchResult sResult = uSearcher.Search("IsInstalled=1 And IsHidden=0"); textBox1.Text = "Found " + sResult.Updates.Count + " updates" + Environment.NewLine; foreach (IUpdate update in sResult.Updates) { textBox1.AppendText(update.Title + Environment.NewLine); } } catch (Exception ex) { Console.WriteLine("Something went wrong: " + ex.Message); }}
Given you have a form with a TextBox this will give you a list of the currently installed updates. Seehttp://msdn.microsoft.com/en-us/library/aa387102(VS.85).aspx for more documentation.
This will, however, not allow you to find KB hotfixes which are not distributed via Windows Update.
0 0
- Windows UPDATE
- Windows UPdate
- windows update
- Windows Update
- Windows update
- Windows Update自动更新
- Windows Update Agent 5.8
- Windows Update Downloader
- WINDOWS UPDATE 错误 80070003
- Windows Update 错误 80070003
- windows update 无法自动更新
- Windows Update 更新问题
- Windows Update之官方解决方案
- [转]Windows 7 Update相关
- Windows CE Update Information Tool
- 取消Win7 Windows Update 更新
- 使用 Windows Update 安装语言包
- 怎样禁用Windows Update功能
- 初涉江湖
- iOS开发之iOS程序偏好设置(Settings Bundle)的使用
- LeetCode之Search Insert Position
- IOS毛玻璃效果
- Test strategy for agile testing
- Windows Update
- Google搜索
- LightOJ 1203 Guarding Bananas (凸包最小顶角)
- linux C如何获取服务器节点上所有网口的ip地址
- wuzhengshu
- java 获取路径
- Metasploit常用web漏洞扫描模块
- eclipse maven plugin 插件 安装 和 配置
- 压力好大啊哎