1 pièce(s) jointe(s)
Operation Update du programme
Salut tout le monde
SVP gentelman .. si vous pouvez m'aider a corriger ce code pour essayer de faire Update a mon programme
J'ai vu plusieurs videos et j'ai j'ai essaye d'appliquer ce que j'ai vu mais malheureusement j'ai eu cet erreur .. malgres que les liens sont bien corrects
Pièce jointe 421336
Merci beaucoup d'avance pour n'importe quelle suggestion
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| Public Class Form1
Public Sub CheckForUpdates()
If ProgressBar1.Value = 100 Then
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://dl.dropbox.com/s/extdecighawem8m/Version.txt?dl=0")
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 = Application.ProductVersion
If newestversion.Contains(currentversion) Then
Button1.Text = ("You are up todate!")
Label2.Text = ("You may now close this dialog")
Else
Button1.Text = ("Downloading update!")
WebBrowser1.Navigate("http://dl.dropbox.com/s/5e1fkjdq5ki87v7/BITTORENT.exe?dl=0")
Label2.Text = ("You may now close this dialog")
End If
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Button1.Enabled = False
Button1.Text = "Checking for updates..."
Timer1.Start()
Label1.Text = ProgressBar1.Value
CheckForUpdates()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(5)
Label1.Text = ProgressBar1.Value
If ProgressBar1.Value = 100 Then
Timer1.Stop()
If ProgressBar1.Value = 100 Then
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://dl.dropbox.com/s/extdecighawem8z/Version.txt?dl=0")
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 = Application.ProductVersion
If newestversion.Contains(currentversion) Then
Button1.Text = ("You are up todate!")
Label2.Text = ("You may now close this dialog")
Else
Button1.Text = ("Downloading update!")
WebBrowser1.Navigate("http://dl.dropbox.com/s/5e1fkjdq5ki87v7/BITTORENT.exe?dl=0")
Label2.Text = ("You may now close this dialog")
End If
End If
End If
End Sub
End Class |
NB : Fichier Text ( 1.0.0.1 )
Amicalement
MADA