Results 1 to 3 of 3

Thread: Asynchronous download no winsock, inet etc..

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Asynchronous download no winsock, inet etc..

    Downloads a file or page html using a usercontrols async method, read about it here,

    http://msdn.microsoft.com/library/de...hasyncread.asp
    Attached Files Attached Files

  2. #2
    Addicted Member JensPeder's Avatar
    Join Date
    Sep 2005
    Posts
    249

    Re: Asynchronous download no winsock, inet etc..

    Heres the one I made earlier, just never got around to post it. Its slightly different than yours. I only got around to make it download txt, though downloading a file woulden't take much editing if they look at your example. Mine also out-sourced the AsyncReadComplete with a Event HTMLComplete on the form
    Attached Files Attached Files

  3. #3
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Asynchronous download no winsock, inet etc..

    @Jmacp,

    Is it possible to modify your code to get the download speed of the file?

    Edit:

    This works!

    vb Code:
    1. Private Sub UserControl_AsyncReadProgress(AsyncProp As AsyncProperty)
    2.     On Error Resume Next
    3.     picAsyncReadDownload.ScaleWidth = AsyncProp.BytesMax
    4.     On Error GoTo 0
    5.     lblProgress.Width = AsyncProp.BytesRead
    6.     lblPercent.Caption = Int((AsyncProp.BytesRead / picAsyncReadDownload.ScaleWidth) * 100) & "%"
    7.     'Data transfer rate
    8.     Form1.Label5.Caption = Format(AsyncProp.BytesRead / (1024 * sw.ElapsedSeconds), "00.00")
    9.     If CSng(Form1.Label5.Caption) <> 0 Then
    10.         'Estimated Time Remaing
    11.         Form1.Label8.Caption = Format(((AsyncProp.BytesMax - AsyncProp.BytesRead) / 1024) / CSng(Form1.Label5.Caption), "00.00") & " Secs."
    12.     End If
    13.     Form1.Label5.Caption = Form1.Label5.Caption & " KB/Sec"
    14.     Form1.Label6.Caption = Int((AsyncProp.BytesRead / picAsyncReadDownload.ScaleWidth) * 100) & "%"
    15. End Sub

    Here is the original thread the code comes from.
    Last edited by Nightwalker83; Aug 27th, 2013 at 09:24 PM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width