Program Update Checker + Manual & Auto Download

  • Thread starter Thread starter Andreas0S
  • Start date Start date
A

Andreas0S

Guest
  • Program Update Checker ( Manual Download = Money :3 )
  • Working Code For Me (Manual) :


If My.Computer.Network.IsAvailable Then
Try
Dim request As System.Net.HttpWebRequest =
System.Net.HttpWebRequest.Create("http://textuploader.com/yourlink/raw")
Dim response As System.Net.HttpWebResponse = request.GetResponse()

Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())

Dim newestversion As String = sr.ReadToEnd()
Dim currentversion As String = "1.0.2.61" <- Program Version

If newestversion.Contains(currentversion) Then
MsgBox("No newer version found!", MsgBoxStyle.Information, "My Program")
Else
If MsgBox("New version : v" & newestversion.ToString & vbNewLine &vbNewLine & "Newer Version Found, download now ?", MsgBoxStyle.YesNo+ MsgBoxStyle.Information, "My program name") = MsgBoxResult.Yes Then
Process.Start("http://adf.ly/yourlink") <- Link to download the program. You can do a End or me.Close in next line to close the program
Else
End If
End If
Catch ex As Exception
MsgBox("Error: " & ex.Message, MsgBoxStyle.Critical, "Error")
End Try
Else
MsgBox("Please check your Internet connection and try again.", MsgBoxStyle.Exclamation, "Error")
End If



  • Program Update Checker ( Auto Download )
  • Working Code For Me (Auto) :

If My.Computer.Network.IsAvailable Then
Try
Dim request As System.Net.HttpWebRequest =
System.Net.HttpWebRequest.Create("http://textuploader.com/yourlink/raw") <- Version check
Dim request1 As System.Net.HttpWebRequest =
System.Net.HttpWebRequest.Create("http://textuploader.com/yourlink/raw") <- Download link check ( Make sure the download link is a direct download link )
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim response1 As System.Net.HttpWebResponse = request1.GetResponse()

Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
Dim sr1 As System.IO.StreamReader = New System.IO.StreamReader(response1.GetResponseStream())

Dim downloadfrom As String = sr1.ReadToEnd()
Dim newestversion As String = sr.ReadToEnd()
Dim currentversion As String = "1.0.2.61" <- Program Version

If newestversion.Contains(currentversion) Then
MsgBox("No newer version found!", MsgBoxStyle.Information, "My Program")
Else
If MsgBox("New version : v" & newestversion.ToString & vbNewLine & vbNewLine & "Newer Version Found, download now ?", MsgBoxStyle.YesNo + MsgBoxStyle.Information, "My program name") = MsgBoxResult.Yes Then
Process.Start(downloadfrom) You can change this to ( my.computer.network.download(downloadfrom, My.Application.Info.DirectoryPath + "\applicationname.apptype" )
Else
End If
End If
Catch ex As Exception
MsgBox("Error: " & ex.Message, MsgBoxStyle.Critical, "Error")
End Try
Else
MsgBox("Please check your Internet connection and try again.", MsgBoxStyle.Exclamation, "Error")
End If

Thats it ;O


.D@RK VISUAL BASIC

Continue reading...
 
Back
Top