Use Web Services in WinForm to automate software upgrades (auto Update)

Source: Internet
Author: User
Tags web services
WinForm programs relative to Web programs, more powerful, more convenient programming, but the software update is quite troublesome, to the client a platform to upgrade, in the face of this practical problem, in a recent small project, I designed a software to achieve automatic upgrade technology scheme to make up for this defect, Has a good reference value.
First, the benefits of the upgrade.
For a long time, the vast number of programmers in the end is the use of client/server, or the use of browser/server structure debate, in these disputes, C/s structure of the program is poor maintainability, layout difficulties, upgrade inconvenient, maintenance costs high is a very important factor, It is also one of the main reasons why B/S supporters will client/server the structure into hell.
Well now, we are using WebServices on the latest Microsoft based WinForm to implement the software automatic upgrade.
Second, the technical principle of the upgrade.
There are several principles of the upgrade, first of all is to compare the existing version with the latest version, found that the latest prompts the user whether to upgrade. Of course, others are compared with other attributes, such as file size. :) or update the date.
And the way to achieve it? In the VB era, I used the xmlhttp+inet control. Use XMLHTTP to get information, use inet to transfer the upgrade file, and use a simple bat file to implement the upgrade.
Public Sub checkupdate ()
On Error Resume Next
Dim B as Boolean
Dim XmlHttp as Object
Set XmlHttp = CreateObject ("Microsoft.XMLHTTP")
Xmlhttp.open "Get", "Http://mu.5inet.net/MuAdmin/update.xml", False
Xmlhttp.send

Dim vs as String
vs = Xmlhttp.responsetext
If err.number > 0 Then
Exit Sub
End If

Dim Xml as Object
Set Xml = CreateObject ("Microsoft.XMLDOM")
Xml.loadxml vs
Dim Version as String
Dim Downaddr as String
Dim Fsize as Long
Dim Finfo as String
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.