Post: Visual Basics - Tutorial = Adding an Update System
09-21-2009, 10:41 PM #1
Classified
Error… Cat invasion!
(adsbygoogle = window.adsbygoogle || []).push({}); Hello,

Recently I've gotten back into coding with Visual basics as I've been making my own Notepad program. And I've been working on a code that I've finally finished, and decided to share with everyone. Of course, I give credit to the people who helped me fix some bugs with this code. Please make sure you have these requirements:

Requirements:

  • Visual Basics 2008
  • FTP Host to upload website files


Once you have Visual Basics 2008 opened, add a button then change the TEXT, not the name, to: Check for updates - Now once that is done, double click on the button. Then once you come the button's coding page, add this code to it:

     Button1.Enabled = False
Button1.Text() = "Checking"
Label1.Text() = "Checking for updates"
WebClient1.DownloadFileAsync(New Uri("https://[B][COLOR="red"]WEBSITELINKHERE[/COLOR][/B]/version.txt"), "version.txt")


Now, once that is done add a label. Make sure it's name is Label1, you can always use a different label as long as you have the right name of the object in the code. After you've done that, go back to the code you added on the button. Change the WEBSITELINKHERE to your website link. Now, after you've done all that stuff right click inside your ToolBox and click: Chose items...

After clicking that, you'll see a huge list of items in the .NET Framework Components tab. Look for the item that says WebClient. You can easily go to it by clicking "W" which will take you to the items that start with the letter W. Find WebClient, check it, and then click OK. Once you've clicked OK, go back to your ToolBox and find the item you added, which is WebClient. After finding it, add it.

Then once you see that it's added (It'll be listed below your Design Screen, where the Timer is also put.) click it once, and then on your very right you'll see a properties box. Near the top of that box, you'll see an icon that looks like Yellow lighting. Click it, and look for DownloadFileCompleted. It's usually the second one listed. Then double click that.

Add this code:

    Dim read As String = My.Computer.FileSystem.ReadAllText("version.txt")
Button1.Text = "Finished"
If Not read = "1.00" Then
If read = "" Then
Label1.Text = "Currently no updates available."
Else
Label1.Text = " " & read & " "
End If
End If


I'm adding screenshots in a little bit, but please give me feedback on this tutorial! Smile

Other

If you want to make the button pop-up again after they click check for updates, simply edit the DownloadFileCompleted code to this:

    Dim read As String = My.Computer.FileSystem.ReadAllText("version.txt")
Button1.Enabled = True
Button1.Text = "Check Again"
Dim read As String = My.Computer.FileSystem.ReadAllText("version.txt")
If Not read = "1.00" Then
If read = "" Then
Label1.Text = "Currently no updates available."
Else
Label1.Text = " " & read & " "
End If
End If


After you have done everything you've wanted, and your ready to notify the users of an update. Open up notepad, or my notepad program, and type in the text you want to have. Maybe a link to the new download, or where to check for the update. Then save that file as version.txt, make sure it's a text file! Then go to your FTP Manager/File Manager, and upload that .txt file. You can always go back to change it. Since you use a WebClient, it goes off reading the webfiles, and what-ever you change it to will be what it displays. No-matter what, even if people don't have the latest verison of your program, once they click "Check for updates," it'll read what you have on your website. (H)
(adsbygoogle = window.adsbygoogle || []).push({});
09-21-2009, 10:45 PM #2
Fionn
Banned
Easy as. Ive got a website full of tutorials for coding but not going to advertise. But im fluent in VB 6-8 . Made everything from notepads to desktop spammers.
09-21-2009, 10:52 PM #3
Classified
Error… Cat invasion!
Originally posted by i
Easy as. Ive got a website full of tutorials for coding but not going to advertise. But im fluent in VB 6-8 . Made everything from notepads to desktop spammers.


And whats your point?
09-21-2009, 10:56 PM #4
Fionn
Banned
Its a very easy language?
09-21-2009, 10:59 PM #5
and this is the wrong section bro sorry
09-21-2009, 11:01 PM #6
Classified
Error… Cat invasion!
Originally posted by i
Its a very easy language?


Well, then you can just get off this thread. Just because "YOU" think it's easy, doesn't mean it's easy for others. Some people are just starting out, or may decide to start out. Just get out, I hate people like you.
09-21-2009, 11:04 PM #7
Fionn
Banned
Love you too.
09-21-2009, 11:25 PM #8
Classified
Error… Cat invasion!
Originally posted by i
Love you too.


Go fall in a hole. Smile
09-21-2009, 11:29 PM #9
Fionn
Banned
That was so offensive. I might cry. That also could be an infraction or warning for flaming another user.
09-21-2009, 11:42 PM #10
Classified
Error… Cat invasion!
Originally posted by i
That was so offensive. I might cry. That also could be an infraction or warning for flaming another user.


And guess what! Go fall in a hole. Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo