C# WSUS在C上的更新#
我现在如何下载修补程序?C# WSUS在C上的更新#,c#,winapi,C#,Winapi,我现在如何下载修补程序? 问题是:我开始下载并关闭我的应用程序,当我启动它时,我需要知道那里发生了什么。我找到了一种方法。我将更新ID列表保存在注册表中,并在从注册表启动应用程序reed时,启动下载 IUpdateSearcher updateSearcher=updateSession.CreateUpdateSearcher(); ISearchResult searchResult=updateSearcher.Search(“IsInstalled=0”) var updateColl
问题是:我开始下载并关闭我的应用程序,当我启动它时,我需要知道那里发生了什么。我找到了一种方法。我将更新ID列表保存在注册表中,并在从注册表启动应用程序reed时,启动下载 IUpdateSearcher updateSearcher=updateSession.CreateUpdateSearcher(); ISearchResult searchResult=updateSearcher.Search(“IsInstalled=0”) var updateCollection=new updateCollection()
for(int i=0;i
在
var progress
中,我得到了正在下载的更新,它的进度您的问题非常不清楚。请阅读并尝试澄清它,以便其他人有机会了解你想要什么。一些示例:文档:
IUpdateSearcher updateSearcher = updateSession.CreateUpdateSearcher();
ISearchResult searchResult = updateSearcher.Search("IsInstalled = 0");
var updateCollection = new UpdateCollection();
for (int i = 0; i < searchResult.Updates.Count; i++)
{
IUpdate update = searchResult.Updates[i];
//update id from registry
if (update.Identity.UpdateID == "081cab8e-faf5-421b-be7c-3e796837f1ff")
{
updateCollection.Add(update);
break;
}
}
downloader = updateSession.CreateUpdateDownloader();
downloader.Updates = updateCollection;
var downloadJob = downloader.BeginDownload(new DownloadProgress(), new DownloadCompleted(), this);
var progress = downloadJob.GetProgress();