2011-02-08 26 views
-1

我現在可以如何下載補丁程序? 問題是:我開始下載並關閉我的應用程序,當我啓動它時,我需要知道那裏發生了什麼。C#上的WSUS更新程序#

+3

別擔心,生活繼續... – 2011-02-08 14:07:26

回答

2

我已經找到了方法。我保存在註冊表更新ID列表,以及從註冊表啓動應用蘆葦,用於開始下載它像

 
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();

var progress我的貓得到哪些更新現在下載和進度