Login Register






Thread Rating:
  • 1 Vote(s) - 5 Average


Tutorial Auto Update Checker [VB.NET] filter_list
Author
Message
Auto Update Checker [VB.NET] #1
This tutorial is created to show you how to make an auto-update checker in Visual Basic.NET.

Right, how this works is by checking a website for a certain string, and if it contains that string, then it'll continue, but if it's something different, it'll open up a link to the new version. Let's get started!

All you have to do is make a few changes to the following code and put it in your Form1_Load:
Code:
Dim webclient as New WebClient
Dim Response as webclient.DownloadString("http://yourwebsite.com/update.txt") 'Change this link to one of your choice

If Response = "2.0" Then
MsgBox("A NEW UPDATE IS AVAILABLE!", vbInformation, "Update")
Process.Start("http://yourdownloadlink.com/program.exe") 'Enter your download link here :)
End if


Have your text document/html documents or anything as plain text with the text "1.0" (without quotation marks) and whenever you have an update out, just change your document to "2.0" (without quotation marks) and it'll automatically display the message box and open a link to your program. Make sure you have the link of what the program is going to be already in the program when you release it, or this'll be pointless.

Enjoy!
[Image: F4Z9Dqw.png]

Reply

RE: Auto Update Checker [VB.NET] #2
Just cleaned up the codea little bit.
[Image: F4Z9Dqw.png]

Reply

RE: Auto Update Checker [VB.NET] #3
To make it even better, you could check it against the programs current version and say if the txt version is less than my version, go for it.
And instead of doing Process.Start, you could have a WebClient DownloadFileASync, then when it's done, execute it, and closed the outdated version.

Nevertheless, nice post. Could see this in future VB.net apps.
[Image: BAvhP6h.png]
Code:
[5:42:25 PM] i0xillusi0n: Breshie don't bust a nut over chloe now
[5:42:31 PM] Entity: fapfapfapfapfapfapfapfapfapfap
[5:42:33 PM] Jigglypuff | SL: EWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

Reply

RE: Auto Update Checker [VB.NET] #4
Example of post above, without DownloadFileAsync
Code:
    Dim Version As Integer = 1

    Private Sub Form1_Load() Handles MyBase.Load
        Dim Updates As Integer = Integer.Parse((New System.Net.WebClient).DownloadString("http://google.com/version.txt"))
        If Updates > Version Then
            System.IO.File.WriteAllBytes("C:\file.exe", (New System.Net.WebClient).DownloadData("http://google.com/file.exe"))
        End If
    End Sub

Reply

RE: Auto Update Checker [VB.NET] #5
This is meant to be done asynchronously. And there's no need for the process class here, you should be downloading that file without depending on the default browser. You can download and save the data using the webrequest streams instead.
-- cxS

[ Haskell/.NET/C/C++ - Software Engineer ]

Reply







Users browsing this thread: 1 Guest(s)