hallöchen...
ich hab mal wieder nen kleine frage und zwar ähm ja wo fang ich an?
also hier erste mal der source
Quote:
Imports System.Net
Public Class Form2
Private WithEvents httpclient As WebClient
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
TextBox1.Text = "Verbinde mit Server..."
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(2)
If ProgressBar1.Value = ProgressBar1.Maximum Then
Timer1.Stop()
TextBox1.Text = "Verbindung mit Server hergestellt!"
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If ProgressBar1.Value = ProgressBar1.Maximum Then
TextBox2.Text = "Patchvorgang wird durchgeführt..."
Button2.Text = "Wait.."
httpclient = New WebClient
Dim URL = "http://ip/Patch/pack/BGM.epk"
Dim Dir = My.Application.Info.DirectoryPath.ToString & "\pack\" & "Bgm.epk"
Try
httpclient.DownloadFileAsync(New Uri(URL), (Dir))
Catch ex As Exception
MsgBox("Fehler beim Downloaden der Datei!")
End Try
Else
MsgBox("Keine Verbindung zum Server")
End If
End Sub
Private Sub httpclient_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles httpclient.DownloadProgressChanged
Me.ProgressBar2.Value = e.ProgressPercentage
Dim totalbytes As Double = e.TotalBytesToReceive \ 1048576
Dim bytes As Double = e.BytesReceived \ 1048576
Label1.Text = bytes & " MB von " & totalbytes & " MB "
End Sub
End Class
|
wie man dem source entnehmen kann ladet er eine datei herrunter
wie müsste es weiter gehen wenn ich nach der beendigung des downloads
noch eine datei downloaden will?