|
-
Feb 5th, 2011, 04:00 PM
#1
Thread Starter
Lively Member
[RESOLVED] Download: Calculating speed and time left (progress bar)
Hi,
I created a software which download files from the web.
I also added a progress bar which shows the download progress.
Every thing works fine.
Now:
- How can I add a lable that will calculate the time left for the file to be downloaded and another label that will tell the speed of the download?
- Would it also be possible to add a lable which calculates the size of the file that is beign downloaded?
Here is what I declared:
Imports System.Net
Public Class Form1
Dim WithEvents Download As New WebClient
Dim WithEvents Download1 As New WebClient
Friend WithEvents Label1 As System.Windows.Forms.Label
Here is what I have under the download button:
Download.DownloadFileAsync(New Uri("URL" & ComboBox1.Text & ".rar"), Textbox1.Text & "\" & ComboBox1.Text & ".rar")
And here is what I have under Download_DownloadProgressChanged:
ProgressBar1.Value = e.ProgressPercentage
Label1.Text = e.ProgressPercentage & "%"
If ProgressBar1.Value = 100 Then
MsgBox("Download Completed!", vbInformation, "Info")
Label1.Text = "0%"
Thanks in advance for your help
Andrea
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|