09-09-16, 10:49 PM
هذا مثال تحميل ملف مع عرض شريط التقدم ProgressBar
كود :
Public Class Form1
Private WithEvents wc As New Net.WebClient
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
wc.DownloadFileAsync(New System.Uri("http://dl.dropboxusercontent.com/s/j100zeaj8csst22/MyDB.accdb"), Application.StartupPath & "\MyDB.accdb")
End Sub
Private Sub wc_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles wc.DownloadProgressChanged
Me.ProgressBar1.Value = e.ProgressPercentage
End Sub
Private Sub wc_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles wc.DownloadFileCompleted
MsgBox("تم التحميل ")
End Sub
End Class
