Partage
  • Partager sur Facebook
  • Partager sur Twitter

Probléme Mise à jour

    25 juillet 2011 à 22:17:41

    Bonjour j'ai un problème ,

    J'ai vb 2010 express est je vois un tuto pour la maj .
    Je mis met alors directement mais la un problème ='( , quand je le test pour voir si sa marche .
    Est non malheureusement sa ne marche pas .
    Si quelqu'un pourrais m'aider .

    Imports System.Net
    
    Public Class Form1
    
    
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Try
                Dim Client As WebClient = New WebClient
                AddHandler Client.DownloadProgressChanged, AddressOf client_ProgressChanged
    
                AddHandler Client.DownloadFileCompleted, AddressOf client_DownloadCompleted
    
                Client.DownloadFileAsync(New Uri("http://mlouki.cfun.fr/Ruf.exe"), ".\Chemin a partir du .exe \Fichier.extension")
                start_dl.Text = "Téléchargement en cours..."
                start_dl.Enabled = False
                Timer1.Start()
                start_dl.Visible = True
                Label1.Visible = True
                Label2.Visible = True
                Label3.Visible = True
                Label4.Visible = True
                Progressbar1.Visible = True
                Button1.Enabled = False
            Catch exception1 As Exception
    
                MessageBox.Show("Téléchargement Echoué !")
    
                start_dl.Text = "Téléchargement Terminé !"
    
                start_dl.Enabled = False
            End Try
        End Sub
    
        Private Sub client_ProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs)
            Try
                Dim bytesIn As Double = Double.Parse(e.BytesReceived.ToString())
                Dim bytesIn3 As Double = bytesIn / 1024
                Dim bytesIn2 As Integer = bytesIn3
                Format(bytesIn2, "#0")
    
                Dim totalBytes As Double = Double.Parse(e.TotalBytesToReceive.ToString())
    
                Dim totalBytes3 As Double = totalBytes / 1024
                Dim totalBytes2 As Integer = totalBytes3
                Format(totalBytes, "#0")
    
                Dim percentage As Double = bytesIn / totalBytes * 100
    
                Progressbar1.Value = Int32.Parse(Math.Truncate(percentage).ToString())
                Label1.Text = bytesIn2
                Label3.Text = totalBytes2
            Catch exception1 As Exception
    
                MessageBox.Show("Téléchargement Echoué !")
    
                start_dl.Text = "Téléchargement Terminé !"
    
                start_dl.Enabled = False
            End Try
        End Sub
    
        Private Sub client_DownloadCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)
            Try
                Progressbar1.Value = Progressbar1.Minimum
                Button1.Enabled = True
                start_dl.Text = "Téléchargement Terminé !"
    
                start_dl.Enabled = False
    
                MessageBox.Show("Téléchargement Terminé !")
                Timer1.Stop()
            Catch exception1 As Exception
    
                MessageBox.Show("Téléchargement Echoué !")
    
                start_dl.Text = "Téléchargement Terminé !"
    
                start_dl.Enabled = False
            End Try
        End Sub
    
        Private Function start_dl() As Object
            Throw New NotImplementedException
        End Function
    
    
    End Class
    
    • Partager sur Facebook
    • Partager sur Twitter
      25 juillet 2011 à 23:43:28

      Bienvenue sur le SdZ,
      vu que tu es nouveau je suis indulgent je t'ai corrigé et déplacé ton message. Puisqu'il s'agit de Visual Basic je l'ai mis dans le forum du même nom. Ensuite il existe une balise code pour colorer le code et le rendre plus lisible pour tes helpers.

      Bonne continuation !
      • Partager sur Facebook
      • Partager sur Twitter

      Probléme Mise à jour

      × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
      × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
      • Editeur
      • Markdown