Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WSUS在C上的更新#_C#_Winapi - Fatal编程技术网

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