
Untitled
By: a guest on
Sep 22nd, 2012 | syntax:
None | size: 1.64 KB | hits: 20 | expires: Never
Imports System.Net
Public Class Form1
WithEvents webclient2 As New WebClient
WithEvents webclient1 As New WebClient
WithEvents webclient3 As New WebClient
Dim versaoatual As String = "C:\uac\atual.dll"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim versaodosite As String = webclient1.DownloadString("http://www.ultimateprojects.com.br/downloads/versao.php")
If versaodosite > versaoatual Then
MessageBox.Show("Nova versão disponível: " & versaodosite & ". Após o Download reinicie programa.")
webclient2.DownloadFileAsync(New Uri("http://www.ultimateprojects.com.br/downloads/UAC.jar"), "C:\uac\UAC.jar")
webclient3.DownloadFileAsync(New Uri("http://www.ultimateprojects.com.br/download/atual.dll"), "C:\uac\atual.dll")
Else
MessageBox.Show("A sua versão é a utlima disponível: " & versaodosite & " faça um bom uso ! ")
Shell("C:\uac\UAC.jar")
End If
End Sub
Private Sub webclient2_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles webclient2.DownloadFileCompleted
MessageBox.Show("Os arquivos da atualização foram baixados com sucesso, reinicie o programa")
End Sub
Private Sub webclient2_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles webclient2.DownloadProgressChanged
ProgressBar1.Maximum = e.TotalBytesToReceive
ProgressBar1.Value = e.BytesReceived
End Sub
End Class