bueno ya lo solucione.
aquí el código de 1 botón, los demás es lo mismo, pero con sus direcciones.
Código vb:
Ver originalPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim client As WebClient = New WebClient
AddHandler client.DownloadProgressChanged, AddressOf client_ProgressChanged
AddHandler client.DownloadFileCompleted, AddressOf client_DownloadCompleted
If IO.Directory.Exists("C:\descargas_launcher") Then
Else
On Error Resume Next
If Err.Number = 0 Then
IO.Directory.CreateDirectory("c:\descargas_launcher")
MsgBox("El directorio Descargas_launcher ha sido creado", MsgBoxStyle.Exclamation, "Descargado!")
Else
Err.Clear()
End If
End If
If IO.File.Exists("C:\descargas_launcher\archivo.rar") Then
MsgBox("El archivo ya esta descargado!", MsgBoxStyle.Exclamation, "Descargado!")
Else
On Error Resume Next
If Err.Number = 0 Then
client.DownloadFileAsync(New Uri("http://direción.a.descargar.rar"), "C:\descargas_launcher\dirección.a.guardar.rar")
Else
MsgBox(Err.Description)
End If
Err.Clear()
ProgressBar1.Visible = True
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Button1.Text = "Descargando..."
Button1.Enabled = False
Button2.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button7.Enabled = False
End If
End Sub
lo que me faltaría es poner la velocidad de red de descarga en el progressbar para las descargas en kbps.
aquí dejo el código de los medidores como los tengo:
Código vb:
Ver originalPrivate Sub client_ProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs)
Dim bytesIn As Double = Double.Parse(e.BytesReceived.ToString())
Dim totalBytes As Double = Double.Parse(e.TotalBytesToReceive.ToString())
Dim percentage As Double = bytesIn / totalBytes * 100
Label1.Text = CStr(e.ProgressPercentage & (" %"))
Label2.Text = CStr(bytesIn / 1024 / 1000 & " MB")
Label3.Text = CStr(totalBytes / 1024 / 1000 & " TOTAL MB")
ProgressBar1.Value = Int32.Parse(Math.Truncate(percentage).ToString())
End Sub
muchísimas gracias por todo tu apoyo de verdad, me ha servido mucho.
lo que no se como poner es lo ultimo dicho y lo ultimo que necesito :D.
un saludete.