|
-
Jun 17th, 2010, 06:22 AM
#1
Thread Starter
PowerPoster
[RESOLVED] DownloadFileAsync no progress
I'm so...  
I'm trying to download a file, which works fine, but the progressbar is showing me no progress and because of that the form doesn't close. Could anyone tell me what is/could be wrong with my code. The weird thing is that the same code is working in my another app.
vb.net Code:
Private WithEvents wClient As New WebClient Private Sub frm_main_update_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try Dim wClient As New WebClient wClient.DownloadFileAsync(New Uri("http://www.website.com/file.exe"), Application.StartupPath & "\file.exe") Catch ex As Exception MessageBoxEx.Show(Err.Number & vbNewLine & Err.Description) End Try End Sub Private Sub wClient_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles wClient.DownloadProgressChanged wClient_progress.Value = e.ProgressPercentage End Sub Private Sub wClient_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles wClient.DownloadFileCompleted MessageBoxEx.Show("Download complete", "Download", MessageBoxButtons.OK, MessageBoxIcon.Information) Me.Close() End Sub
Last edited by Radjesh Klauke; Jun 17th, 2010 at 06:34 AM.
-
Jun 17th, 2010, 07:35 AM
#2
Addicted Member
Re: DownloadFileAsync no progress
Nevermind, I was incorrect.
Last edited by Spirited Machine; Jun 17th, 2010 at 07:41 AM.
-
Jun 17th, 2010, 11:34 AM
#3
Re: DownloadFileAsync no progress
Line 5: Dim wClient As New WebClient
Remove it.
-
Jun 18th, 2010, 03:48 AM
#4
Thread Starter
PowerPoster
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
|