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

.NET 

Update _ Download. Checking for updates and Downloading the program. - VB.NET

Hello guys 😉🤗
I will share one code that checks for updates and one for program downloading, if a new version found.


( WARNING : This Code Works Under Visual Studio 2015. Leave A Reply If You Have An Error )


Check For Updates CODE :
Code
''              'Paste this code in Check For Updates button'
                Dim request As Net.HttpWebRequest = Net.WebRequest.Create("http ://www .link.com")
                Dim response As Net.HttpWebResponse = request.GetResponse()
                Dim rs As StreamReader = New StreamReader(response.GetResponseStream())
                Dim nversion As String = rs.ReadToEnd()
                Dim cversion As String = " Application Version "

                If nversion.Contains(cversion) Then
                    MsgBox("No Updates Found", MsgBoxStyle.Information, "Check For Updates")
                Else
                    If MsgBox("Newer Version Found. Download Now?", MsgBoxStyle.YesNo + MsgBoxStyle.Information, "Check For Updates") = MsgBoxResult.Yes Then
                        Process.Start(Application.StartupPath + "\The program name that will download the updates.exe")
                        End
                    Else
                    End If
                End If
Downloader CODE :
Code
''              'Paste this in the top of the source code'
                Imports System.ComponentModel
                Imports System.Net
                'Paste this in the download button or in form load'
                Dim request As HttpWebRequest =
                WebRequest.Create(" the download link " 'make sure its direct download link')
                Dim response As HttpWebResponse = request.GetResponse()
                Dim sr As IO.StreamReader = New IO.StreamReader(response.GetResponseStream())
                Dim downloadfrom As String = sr.ReadToEnd()

                Try
                    download = New WebClient
                    download.DownloadFileAsync(New Uri(downloadfrom), Application.StartupPath + "\ The program name .exe")
                Catch ex As Exception
                    MsgBox("Error ! " + vbNewLine + ex.Message, MsgBoxStyle.Critical, "Error")
                    End
                End Try



About the link :
Im using textuploader .com to upload a text with the version and direct download link.
So simply is going like textuploader .com/blabla/raw
For direct download link im using Ozibox.

About the code :
If you have a check for updates program then you can just put the download code after the 'MsgBoxResult.Yes Then' of the check for updates code.
Make sure you have the first program close or add a proc kill code.



Yeah 😁 Greetings from MadnessForCrack™
before i even clicked on the thread i already had this coded in my head almost the exact way but i use dropbox or GDrive. good job OP keep learning.
(Sep 23, 2015 05:48 PM)SIM-1984933 Wrote:  before i even clicked on the thread i already had this coded in my head almost the exact way but i use dropbox or GDrive. good job OP keep learning.

You can get direct links on gDrive? that's new.
Nice share... But i think you are still using old msgbox function... for .net 3.5 framework & above you should use messagebox.show ;)
BTC - bc1q3efew3yzfwhdz290dafykaw0a2w56g2j69g2c6
ETH - 0xf1c873217032468990D3313da6509D1b813c4671
USDT - 0xf1c873217032468990D3313da6509D1b813c4671
PP - [email protected]
(Sep 23, 2015 07:02 PM)He B TeMy Wrote:  You can get direct links on gDrive? that's new.
i've never done it from gDrive but my friend allegedly says he uses it in place of dropbox
I mean it's nice and all, but can be rewritten in something like 10 lines max total. First of all, you can just use a webclient to download a string, and secondly you don't need to create an external process, I mean not a separate custom app. You can just start cmd, and make it kill & delete the current version and rename & start the new version. And last, but certainly not least, dispose your objects aka wrap them in using statements.
I like this due to the fact, I would use it. While yes the checker could be shortened a bit; it works and can also incorporate settings into this.
* nathan72389 inhales, exhales....
ok, why on earth would you use a second application to update your program when you can not even pass it command line variables? your killing yourself right there.

look another "super duper updater" thread. guess what, there will be another coma along in 2 weeks with the same code.
..check string
...download app

there is nothing new here, just look back a few weeks. this is the same concept that they teach you in 101 type stuff.
wow O, now you know how to compare a sting and if string A is different than string B do C.
(Sep 25, 2015 12:56 PM)nathan72389 Wrote:  * nathan72389 inhales, exhales....
ok, why on earth would you use a second application to update your program when you can not even pass it command line variables? your killing yourself right there.

look another "super duper updater" thread. guess what, there will be another coma along in 2 weeks with the same code.
..check string
...download app

there is nothing new here, just look back a few weeks. this is the same concept that they teach you in 101 type stuff.
wow O, now you know how to compare a sting and if string A is different than string B do C.

iRuSTecH inhales, exhales....

Stop hating (start loving and helping) and i don't give a funk if you can program better than me. Thanks ! ~ :)
Ow before some weeks i was no here.
Also nathan72389. Think, write and paste a better code down here if you are pro :)

When other do it. We improve it 'Team Reis' ! This code it's not mine i just improve it about 3 years ago !!!

ALSO GUYS DON'T WAIT FROM PEOPLE TO SHARE HIS FULL CODES ! WE JUST SHARE SOMETHING THAT WORKS !



(Sep 25, 2015 10:33 AM)SIM-1456245 Wrote:  I mean it's nice and all, but can be rewritten in something like 10 lines max total. First of all, you can just use a webclient to download a string, and secondly you don't need to create an external process, I mean not a separate custom app. You can just start cmd, and make it kill & delete the current version and rename & start the new version. And last, but certainly not least, dispose your objects aka wrap them in using statements.

Sorry but i NAMED the post "VB.NET" so this will have ONLY VB CODE VB VB VB. NO CMD '.BAT' JAR PEARL OR WHATEVER.
Thanks.
(Sep 26, 2015 11:41 AM)iRuSTecH Wrote:  iRuSTecH inhales, exhales....

Sorry but i NAMED the post "VB.NET" so this will have ONLY VB CODE VB VB VB. NO CMD '.BAT' JAR PEARL OR WHATEVER.
Thanks.

I'm just telling you how it's supposed to be done, and you can do it however you want to.
Of course and thanks. But i'm doing it with the vb way.

This works so i don't care a lot
Great release. I use the same code


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Emre_Oct 27, 2020 02:48 AM 3 157 Oct 27, 2020 02:48 AM
Last Post: VisualSoft
[Shell] by Emre_Aug 31, 2019 07:14 AM 0 107 Aug 31, 2019 07:14 AM
Last Post: Emre_
[.NET] by TerminallyIllDec 24, 2018 09:17 AM 5 194 Dec 24, 2018 09:17 AM
Last Post: CreatedAutomated