Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[Simple] Updating System For Your Application

Okey, im posting this simple updating system I made.

What are we going to use?
  • Webclient
  • Label
  • If/Else
  • DownloadFile

Ok, in your program put:

Under Class Form1
Code
Dim Version As String = "1.0"

Form1.Load
Code
Label1.text = Version

Next, we need a host for our file, which we use, to upload the .exe and see if theres a update.

Upload a text file to your host with ONLY 2.0 in it.

Now lets check for a update.
Form1.Load // Buton1
Code
Dim NewVersion As String
Dim WebC As New Webclient

Try
NewVersion = WebC.DownloadString("<linktoversion.txt>")
Catch ex As Exception      
NewVersion =  WebC.DownloadString("<linktoversion.txt>") ' Try again most of the times, if it doesnt connect the first time, it will now.
        End Try
If NewVersion = Version Then
Label2.text = "No New Updates"
else
Label2.text = "New Update!"
End If

Ok, so now it checks if there is a update, you will need to update the text file every time you upload a new update.
Now lets make it download

Button2
Code
Dim Webc As New Webclient
If Label2.text = "New Update!" Then
Webc.DownloadFile("<linktournewfile>", "<nameuwantittoget>")
Label2.text = "No New Updates"
End If

I fully wrote this myself, enjoy.
FR1908
This will come in handy, thanks.
Nice work dude :D
<tooshort>
Glad you both liked it :)
FR1908
very handy....will add it to my next project
PHP & .NET Contributor.
Great tut. Was searching for this.
(May 8, 2010 02:12 AM)REVZ Wrote:  Great tut. Was searching for this.

No problem :)
FR1908
Nice work man!

2short
(May 8, 2010 04:29 AM)Grieve™ Wrote:  Nice work man!

2short

Enjoy it :)
FR1908


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by neon_lightApr 17, 2021 08:59 AM 16 1,016 Apr 17, 2021 08:59 AM
Last Post: Stanley
[Java] by TennoFeb 3, 2019 04:49 AM 4 306 Feb 3, 2019 04:49 AM
Last Post: Tenno
[C#] by siimon00Sep 28, 2016 09:58 PM 5 200 Sep 28, 2016 09:58 PM
Last Post: some_dude13