需要为远程WUApiLib

时间:2016-05-06 06:14:34

标签: c# windows-administration wuapi

需要在远程PC上启用哪些内容才能远程使用WUApiLib?我有这个代码,它返回错误80070005

Type t = Type.GetTypeFromProgID("Microsoft.Update.Session", "192.168.1.14");
        UpdateSession uSession = (UpdateSession)Activator.CreateInstance(t);
        IUpdateSearcher uSearcher = uSession.CreateUpdateSearcher();
        uSearcher.Online = false;
        IUpdateHistoryEntryCollection history = uSearcher.QueryHistory(0, uSearcher.GetTotalHistoryCount());
        for (int i = 0; i < history.Count; ++i)
        {
            Console.WriteLine(history[i].Title);
        }

0 个答案:

没有答案