BenArticleModify the deficiencies and errors in previous articles. Hope to help you.
In Vista and XP, wua varies in many places, depending on the XP Automatic update version. The biggest difference is that after the Xp-sp2 is installed, the wua version is relatively old, and many functions in the interface are not provided. For example: proxy class, iupdate3, iupdatesearcher2, etc. Therefore, when developing with. net, pay attention to whether the client has updated wua. Basically, the latest wua version is V6. It is slightly different from the version provided in Vista.
Proxy:
For example, if a company sets up a proxy, it will not be updated in XP, but Vista will, because the dialog box for users to enter the username and password of the proxy will pop up in Vista. In this caseProgramTo search, download, and install, you must first create a proxy class and then create an operation class for the proxy class.
CodeRefer to the following:
1 Wuapilib. updatesessionclass session = New Wuapilib. updatesessionclass ();
2
3 Session. WebProxy. Address = @" ********** " ;
4 Session. WebProxy. promptforcredentials (sender, " Input your passport! " );
Promptforcredentials method. The system dialog box is displayed. After you enter the user name and password, it is automatically assigned to the proxy class.
1 Wuapilib. iupdatesearcher upsearch = Session. createupdatesearcher ();
2 Wuapilib. iupdatedownloader updownload = Session. createupdatedownloader ();
3 Wuapilib. iupdateinstaller2 upinstall = (Wuapilib. iupdateinstaller2) Session. createupdateinstaller ();
Finally, if you are using the D version of the operating system, the automatic update first requires you to update the WGA, and the subsequent program can be updated only when the verification is passed, you can use your own programs to update parts that cannot be updated automatically under XP, such as drivers.
I am also working on related software. I will share it with you later.