Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've done the exact thing this in an application of my own.</p> <p>First, you store an XML file on your webhost that holds the updater information. Mine is at <a href="http://getquitter.com/version.xml" rel="nofollow">http://getquitter.com/version.xml</a> and is structured as follows:</p> <pre><code>&lt;versioninformation&gt; &lt;latestversion&gt;1.2.0.0&lt;/latestversion&gt; &lt;latestversionurl&gt;http://www.getquitter.com/quitter-1.2.0.zip&lt;/latestversionurl&gt; &lt;filename&gt;quitter-1.2.0.zip&lt;/filename&gt; &lt;/versioninformation&gt; </code></pre> <p>Second, write a method to retrieve that xml from your host:</p> <pre><code>Public Function GetWebPage(ByVal URL As String) As String Dim Request As System.Net.HttpWebRequest = CType(WebRequest.Create(New Uri(URL)), HttpWebRequest) With Request .Method = "GET" .MaximumAutomaticRedirections = 4 .MaximumResponseHeadersLength = 4 .ContentLength = 0 End With Dim ReadStream As StreamReader = Nothing Dim Response As HttpWebResponse = Nothing Dim ResponseText As String = String.Empty Try Response = CType(Request.GetResponse, HttpWebResponse) Dim ReceiveStream As Stream = Response.GetResponseStream ReadStream = New StreamReader(ReceiveStream, System.Text.Encoding.UTF8) ResponseText = ReadStream.ReadToEnd Response.Close() ReadStream.Close() Catch ex As Exception ResponseText = String.Empty End Try Return ResponseText End Function </code></pre> <p>Next, call this method to get the xml and load into an xml document.</p> <pre><code>Dim VersionInfo As New System.Xml.XmlDocument VersionInfo.LoadXml(GetWebPage("http://www.getquitter.com/version.xml")) </code></pre> <p>With version.xml loaded, you can now parse out the individual pieces of data you need to determine whether or not you need to grab the new version.</p> <pre><code>Dim LatestVersion As New Version(QuitterInfoXML.SelectSingleNode("//latestversion").InnerText) Dim CurrentVersion As Version = My.Application.Info.Version If LatestVersion &gt; CurrentVersion Then ''download the new version using the Url in the xml End If </code></pre> <p>This is how my application does it. You can download the source code if you like (it's an open source application) if you'd like to use it as a model. It's at <a href="http://quitter.codeplex.com" rel="nofollow">http://quitter.codeplex.com</a>. Hope this helps!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload