Results 1 to 35 of 35

Thread: VB6 Simple Async-Download-Ctl for multiple Files

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    VB6 Simple Async-Download-Ctl for multiple Files

    Just a simple demonstration of the AsyncDownload-Feature, any VB-Usercontrol has already built-in.

    It supports http- and ftp-downloads for files up to 2GB.

    What's perhaps interesting from a Control-Design-point, is the organization of the whole thing.

    There's a Host-Control: ucAsyncDLHost which only ensures Scrolling and Event-Delegation of the
    separate Download-Entries it manages and visualizes.

    The AsyncDownload itself is performed within another (Child-)Control: ucAsyncDLStripe,
    which is a windowless-Control (containing a simple Progress-Bar and a simple Stop/Resume-Button).

    So, those windowless-"Stripe-entries" make up the "Rows" within the outer ucAsyncDLHost Control.

    Here's the usual Screenshot and the Download-Link:

    http://vbRichClient.com/Downloads/As...nloadDemo2.zip

    Olaf
    Attached Images Attached Images  
    Last edited by Schmidt; Sep 7th, 2013 at 08:18 PM. Reason: Updated the Zip-Content

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

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Hi,

    I receive

    Procedure declaration does not match description of event or procedure having same name

    on this line

    vb Code:
    1. Private Sub ucAsyncDLHost_DownloadComplete(Sender As ucAsyncDLStripe, ByVal TmpFileName As String)
    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

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by Nightwalker83 View Post
    Hi,

    I receive

    Procedure declaration does not match description of event or procedure having same name

    on this line

    vb Code:
    1. Private Sub ucAsyncDLHost_DownloadComplete(Sender As ucAsyncDLStripe, ByVal TmpFileName As String)

    Just noticed, that in ucAsyncDLHost I still had a Copy&Paste-bug in the Property-Get-Methods:
    DownloadStripeByURL
    and
    DownloadStripeByLocalFileName

    But I think that this is not related to the error you reported above - still I'd like when you could download
    again from the now updated Zip-Content behind the Download-Link in the Opener-Post - and try the
    original project without any changes...

    Did you already ripped the two ucAsync___.ctls out of the original project - or was the error encountered
    running the original project (as contained in the *.zip)?


    Olaf

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

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by Schmidt View Post
    Did you already ripped the two ucAsync___.ctls out of the original project - or was the error encountered
    running the original project (as contained in the *.zip)?
    I run the project as it was in the zip file to try and understand how things work first.
    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

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by Nightwalker83 View Post
    I run the project as it was in the zip file to try and understand how things work first.
    Then I'd like you to make a second try with my now definitely updated Zip (which I had to give a different
    FileName, AsyncDownloadDemo2.zip, since my WebServer was not releasing the old one properly).

    Aside from that problem - even with the older version I could not reproduce your above mentioned Error
    ("Procedure declaration does not match description of event or procedure having same name")
    here on my machine.

    Do you run VB6 - or is this by any chance a VB5 you're using?
    In case it's VB6, what VB-Servicepack do you have installed (and what Windows-Version are you using)?

    Olaf

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

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by Schmidt View Post
    In case it's VB6, what VB-Servicepack do you have installed (and what Windows-Version are you using)?
    VB6.0 with SP6.
    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

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by Nightwalker83 View Post
    VB6.0 with SP6.
    That's good to know - and as said, it would be nice when you could make a second attempt
    (maybe in a new unzip-folder, to be entirely sure) - with the updated Zip-File from the Opener-Post-Link ... here the Link again:
    http://vbrichclient.com/Downloads/As...nloadDemo2.zip

    I've just tested Downloading per Browser on two different machines (one running XP, the other Win7, both with VB6/SP6)
    and I can't reproduce your error ...

    Could you give a bit more information about your attempts - if the error happens again on your machine -
    and under what concrete circumstances (IDE, compiled Executable, already whilst starting the project the first time -
    or somewhere in-between - or at Form-Unload-Time)?

    Olaf

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

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Where does it put the files I download with your project? I have tried to download by running the project as is and both progress bars are working at the same time but no files appear after the downloads finish.
    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

  9. #9

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by Nightwalker83 View Post
    Where does it put the files I download with your project? I have tried to download by running the project as is and both progress bars are working at the same time but no files appear after the downloads finish.
    Here is, what I've commented in the DownloadComplete Event-Handler:

    Code:
    Private Sub ucAsyncDLHost_DownloadComplete(Sender As ucAsyncDLStripe, ByVal TmpFileName As String)
      Debug.Print "DownloadComplete for URL: "; Sender.URL
      
      'the complete-event delivers a temporary filename - it is up to the user
      'of the Control, to decide what to do with this TmpFile... the usual reaction will be
      'a simple File-Renaming (ensuring an implicit Move-Operation on the FileSystem then)
      'the Sender is the Control-Stripe of our DownloadListHost-Control - and in the Add-methods
      'in the Form-Load-Event above, we have defined a "target-LocalFilename" already, which is
      'associated with the matching URL (which was the Source of this completed Download here)
      'This target-filename is (so far) only stored as String within the Stripe (Sender.LocalFileName)
      
      'So, yeah - just ensure a proper Move/Rename of the delivered TmpFileName
      
    '  Name TmpFileName As Sender.LocalFileName
    End Sub

    The last line I've left commented out - it was only a (simplified) suggestion, since I do not know,
    what the developer decides or prefers to do finally with the delivered TmpFilename.

    If you want "to see something in the App.Path", then you will just have to comment the last line in (the one with VBs Name-statement).


    Or instead of the simplified single-line Name statement, use an Error-buffered variant, which asks, when the Destination-FIle already exists:

    Code:
      On Error Resume Next
        Name TmpFileName As Sender.LocalFileName
      If Err Then
        If MsgBox(Err.Description & vbCrLf & "Force a replace with the new File?", vbYesNo) = vbYes Then
          Kill Sender.LocalFileName
          Name TmpFileName As Sender.LocalFileName
        Else
          Kill TmpFileName
        End If
        Err.Clear
      End If
    Or alternatively (in case you prefer a "Side-by-Side-Auto-Numbering" of new downloaded Files, when similar Names
    already exist in the Destination-Folder, you can use the Shell32-Object (or the SHFileOp-API) with the FOF_RenameOnCollision-Flag.

    Just adapt the example to your needs - these "final decisions" are deliberately not made within the Downloader-Controls -
    instead they are left to the User, over appropriately thrown events like the one above.


    Olaf

  10. #10
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    341

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    This demo uses the AsyncRead method of UserControl, which is "right there" in VB6, but not available in other places, i.e. VBA ...

    I use WinHttpRequest a lot, and it supports asynchronous requests. Is it possible to use WinHttpRequest for asynchronous file downloads. Just curious. Haven't tried it yet.
    Last edited by bPrice; Mar 29th, 2016 at 10:18 AM.

  11. #11
    Hyperactive Member
    Join Date
    Sep 2014
    Posts
    341

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    The cDownloads/cDownload in RC5 is synchrounous as it turned out...

    Code:
    Private WithEvents d As cDownloads
    Sub Test()
    
    Set d = New_c.Downloads
    d.Download "http://www.vbforums.com/attachment.php?attachmentid=104369&stc=1&d=1378585318"
    
    End Sub
    Private Sub d_DownloadComplete(DownloadObj As vbRichClient5.cDownload, ByVal ErrNum As Long, ErrString As String)
        Debug.Print "complete: " & DownloadObj.URL, ErrNum, ErrString
    End Sub
    Private Sub d_DownloadProgress(DownloadObj As vbRichClient5.cDownload, ByVal Percent As Single, ByVal StatusCode As Long, StatusDescription As String, StatusValue As String)
        Debug.Print "progress: " & DownloadObj.URL, Percent, StatusCode, StatusDescription, StatusValue
    End Sub
    Private Sub d_DownloadStart(DownloadObj As vbRichClient5.cDownload)
        Debug.Print "start: " & DownloadObj.URL
    End Sub
    May I ask how cDownload is implemented? What API/Components it is making use of? Perhaps, the URLDownloadToFile in urlmon.dll?
    Last edited by bPrice; Mar 29th, 2016 at 10:27 AM.

  12. #12
    Fanatic Member
    Join Date
    Sep 2010
    Location
    Italy
    Posts
    678

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    What happens if the URL do Not exist ?
    Is it better to check somehow existence before AddDownloadJob ? [ if yes , how? is there a fast way? ]

    PS
    I ask this because I have to do this thing:
    download a file of which I only partially know the address.
    I know the name of the file and all the url except a number, which for example can be between 1 and 10.
    The possible urls can be:
    https://site.com/1/Picture.jpg
    https://site.com/2/Picture.jpg
    https://site.com/3/Picture.jpg
    ...
    I don't know wich one is correct, so I have to try them all.

  13. #13

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by reexre View Post
    What happens if the URL do Not exist ?
    You'll have to try the download of course (in either case)...
    If the resource which is described by the URL (the Uniform Resource Locator) does not exist at the serverside,
    you will get an appropriate (http-protocol) status-message from the WebServer (in VBs UserControl transported in the AsyncEvents-Status-Params).

    Such failing http-requests should "return fast" -
    and it's up to you to ensure, that you remove such "Jobs" from the JobList as soon as possible.

    Olaf

  14. #14
    Fanatic Member
    Join Date
    Sep 2010
    Location
    Italy
    Posts
    678

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Thanks!
    So I added blue line to remove Control
    Code:
    Private Sub UserControl_AsyncReadComplete(AsyncProp As AsyncProperty)
    
        On Error Resume Next   
    
        If AsyncProp.StatusCode <> vbAsyncStatusCodeEndDownloadData Or AsyncProp.BytesRead = 0 Then
    
            Parent.RaiseDownloadError Me, AsyncProp.StatusCode, AsyncProp.Status
                         
            Parent.RemoveByURL Me.URL               
            
            CancelDownload
     
        Else
            Parent.RaiseDownloadComplete Me, AsyncProp.Value
            Parent.RemoveByLocalFileName mLocalFileName    'let's remove ourselves from the List in the Parent-Control
        End If
    End Sub

    Code:
    Public Sub RemoveByURL(ByVal URL As String)
        Dim CtlKey  As String
        CtlKey = GetCtlKeyForURL(URL)
        If Len(CtlKey) = 0 Then Exit Sub
        Controls.Remove CtlKey
        VScroll_Change
    End Sub

  15. #15
    Fanatic Member
    Join Date
    Sep 2010
    Location
    Italy
    Posts
    678

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    It seems to me that closing the Form containing the ucAsyncDLHost control with active downloads causes an app crash.
    Maybe I'm wrong. I'm not sure, but if so, what is the correct way to remove all downloads before closing? (assuming I had not kept track of them)

  16. #16

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by reexre View Post
    It seems to me that closing the Form containing the ucAsyncDLHost control with active downloads causes an app crash.
    Maybe I'm wrong. I'm not sure, but if so, what is the correct way to remove all downloads before closing? (assuming I had not kept track of them)
    There is a Method: Public Sub CancelDownload()
    in each "Download-Stripe-Control", which would have to be called, to make sure that "pending async Jobs" are cleared.

    Ideally that Cancel-Method should be called, before the ucAsyncDLHost-Method: RemoveByLocalFileName
    will remove and destroy the appropriate ucAsyncDLStripe-Control.

    Only after all Stripes were cancelled (AsyncJob-wise) and then Removed from the Host-Control,
    should the Host-Control itself be unloaded (together with its hosting Form).

    Another variant would be, to "Cancel unloading the Form", as long as there are still
    "async-stripe-jobs" running (when the Host-Control has a JobCount>0).

    HTH

    Olaf

  17. #17
    Fanatic Member
    Join Date
    Sep 2010
    Location
    Italy
    Posts
    678

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Thanks, I've partially resolved this way:

    Fisrt of on ucAsyncDLHost I added this sub:
    Code:
    Public Sub CancelALLDownloads()
        Dim C         As Control
        For Each C In Controls
            If Left$(C.Name, 1) = "K" Then
                C.CancelDownload
            End If
        Next
    End Sub
    and then added on Form:
    Code:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    ucAsyncDLHost.CancelALLDownloads
    End Sub
    Still not well tested but seems to work.

    BTW: seems that "only controls that are created via Load can be deleted at runtime."

  18. #18

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by reexre View Post
    BTW: seems that "only controls that are created via Load can be deleted at runtime."
    That was probably true for VB5 (where Controls.Add and Controls.Remove didn't exist).

    With VB6 one can use both (the old Control-Array-based Load/Unload-mechanism, as well as the new introduced Controls.Add/Remove).

    As said - the Controls.Remove-call is currently included in the little wrapper method: RemoveByLocalFileName

    For your case (a "well-ordered retreat" in the "Form-TearDown-phase"), the cancelling of all still running async-download-jobs is probably enough
    (no need to remove the "async-job-hosting" Stripe-Controls from their Host-Controls-Collection, since this is done anyways under the covers, when the Form finally closes).

    Olaf

  19. #19
    Addicted Member
    Join Date
    May 2016
    Location
    China
    Posts
    197

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    The test was completed normally, but did not see the downloaded file: there is no ZIP file in the current directory, and the file after re-specifying the file does not find the downloaded file.
    QQ: 289778005

  20. #20

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by ChenLin View Post
    The test was completed normally, but did not see the downloaded file: there is no ZIP file in the current directory, and the file after re-specifying the file does not find the downloaded file.
    Please read the comment, as it sits in the Test-Forms DownloadComplete-EventHandler:
    Code:
    Private Sub ucAsyncDLHost_DownloadComplete(Sender As ucAsyncDLStripe, ByVal TmpFileName As String)
      Debug.Print "DownloadComplete for URL: "; Sender.URL
      
      'the complete-event delivers a temporary filename - it is up to the user
      'of the Control, to decide what to do with this TmpFile... the usual reaction will be
      'a simple File-Renaming (ensuring an implicit Move-Operation on the FileSystem then)
      'the Sender is the Control-Stripe of our DownloadListHost-Control - and in the Add-methods
      'in the Form-Load-Event above, we have defined a "target-LocalFilename" already, which is
      'associated with the matching URL (which was the Source of this completed Download here)
      'This target-filename is (so far) only stored as String within the Stripe (Sender.LocalFileName)
      
      'So, yeah - just ensure a proper Move/Rename of the delivered TmpFileName
      
    '  Name TmpFileName As Sender.LocalFileName
    End Sub
    Olaf

  21. #21
    Addicted Member
    Join Date
    May 2016
    Location
    China
    Posts
    197

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    problem solved:

    Code:
    Private Sub ucAsyncDLHost_DownloadComplete(Sender As ucAsyncDLStripe, ByVal TmpFileName As String)
      Debug.Print "DownloadComplete for URL: "; Sender.URL
      Dim aTmp As Variant
      aTmp = Split(Sender.URL, "/")
      FileCopy TmpFileName, App.Path & "\" & aTmp(UBound(aTmp))
      Kill TmpFileName
      'the complete-event delivers a temporary filename - it is up to the user
      'of the Control, to decide what to do with this TmpFile... the usual reaction will be
      'a simple File-Renaming (ensuring an implicit Move-Operation on the FileSystem then)
      'the Sender is the Control-Stripe of our DownloadListHost-Control - and in the Add-methods
      'in the Form-Load-Event above, we have defined a "target-LocalFilename" already, which is
      'associated with the matching URL (which was the Source of this completed Download here)
      'This target-filename is (so far) only stored as String within the Stripe (Sender.LocalFileName)
      
      'So, yeah - just ensure a proper Move/Rename of the delivered TmpFileName
      
    '  Name TmpFileName As Sender.LocalFileName
    End Sub
    QQ: 289778005

  22. #22
    Junior Member
    Join Date
    May 2018
    Posts
    22

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    How to support a password FTP file download, thank you!

  23. #23

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by yinxiaodan View Post
    How to support a password FTP file download, thank you!
    The VB-Usercontrol-Async-support does not offer this via Parameters,
    so you'll have to try passing the credentials in the old-fashioned way, by directly including them in the (ftp-)URL:
    Code:
    ftp://username:password@domain.com/somepath/...
    HTH

    Olaf
    Last edited by Schmidt; Mar 28th, 2019 at 12:50 PM.

  24. #24
    Fanatic Member
    Join Date
    Sep 2010
    Location
    Italy
    Posts
    678

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Sorry, but I have a problem that I don't understand.
    I use this code to update the PhotoModularFX program, and to download project previews. (This is done on MouseOver a project in projectlist)
    While in windows7 everything works well, in windowsVista I encountered this problem.
    It works well for some urls while for others it doesn't. In particular:
    Works:
    * https://raw.githubusercontent.com/mi...FX/History.txt
    * https://raw.githubusercontent.com/mi...oModularFX.zip
    DO NOT WORK:
    * Https://miorsoft.github.io/Site/Proj...bs/1/00002.jpg

    UserControl_AsyncReadComplete is fired with SratusCode = 0 just when trying to Connect.

    Can anyone tell me what it depends on and how to solve the problem?
    Thanks
    ( If more details are needed let me know )

    PS: I still have to try this url on Vista
    https://raw.githubusercontent.com/mi...bs/1/00002.jpg
    I'll do it in the next few days. (when physically available)

  25. #25

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by reexre View Post
    [https-based secure transfers sometimes work - sometimes not (on older systems)]

    UserControl_AsyncReadComplete if fired with SratusCode = 0 just when trying to Connect.
    It's basically the same problem we've already discussed some time ago - in a different thread
    (and which is still brought up by others - any 2 months or so)...

    The SSL/TLS stack of those older systems is sometimes enough (when the sites SSL-certificate is satisfied with "old enough" security-methods/algos) -
    but for newer SSL-certs (which specify and require more modern crypto-algos in usually higher bit-length) the https requests might fail on such older systems.

    There is not much one can do, other than suggesting to install the newest SSL-Upgrades (along with the newest available IE-install for that system).

    An alternative to all the "builtin-MS-crypto- and MS-http-libs" would be libCurl.dll (which comes with its own, usually OpenSSL-based crypto-implementations).
    This would then support proper https-requests "down to Win98" - but libCurl (in its Win-Version) is quite large binary-wise - and it comes with a few additional Dll-dependencies -
    and has a completely different API.

    Olaf

  26. #26

  27. #27
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,064

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by Schmidt View Post
    An alternative to all the "builtin-MS-crypto- and MS-http-libs" would be libCurl.dll (which comes with its own, usually OpenSSL-based crypto-implementations).
    Hello; and what about using WinHTTP, would it fail too?

  28. #28

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by Eduardo- View Post
    Hello; and what about using WinHTTP, would it fail too?
    Probably (many MS-http-wrappers will use the same flat-api-stack in the end - especially when it finally comes to the crypto-stuff).
    So you'll have to test (on older systems, which don't have the latest crypto-libs).

    Many older sites still allow access via unencrypted, plain http-channels - so that could be (or seems like) a fallback-option which would always work...
    Though on most modern sites, https is enforced via a clientside redirect - as e.g. the URL reexre has posted:
    https://miorsoft.github.io/Site/Proj...bs/1/00002.jpg

    even when you try to navigate to it via "plain http://..." - you will end up with an enforced https-request in the end.

    Olaf

  29. #29

  30. #30
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,163

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Here are some results from ciphers test w/ openssl for miorsoft.github.io
    Code:
    wqw@wqw-pc:~$ ./test_ciphers miorsoft.github.io:443
    Testing ECDHE-RSA-AES256-GCM-SHA384...YES
    Testing ECDHE-RSA-AES256-SHA384...YES
    Testing ECDHE-RSA-AES256-SHA...YES
    Testing AES256-SHA...YES
    Testing ECDHE-RSA-AES128-GCM-SHA256...YES
    Testing ECDHE-RSA-AES128-SHA256...YES
    Testing ECDHE-RSA-AES128-SHA...YES
    Testing AES128-GCM-SHA256...YES
    Testing AES128-SHA...YES
    Testing ECDHE-ECDSA-AES256-GCM-SHA384...NO (sslv3 alert handshake failure)
    Testing ECDHE-ECDSA-AES256-SHA384...NO (sslv3 alert handshake failure)
    Testing ECDHE-ECDSA-AES256-SHA...NO (sslv3 alert handshake failure)
    Testing SRP-DSS-AES-256-CBC-SHA...NO (no ciphers available)
    Testing SRP-RSA-AES-256-CBC-SHA...NO (no ciphers available)
    Testing SRP-AES-256-CBC-SHA...NO (no ciphers available)
    Testing DH-DSS-AES256-GCM-SHA384...NO (sslv3 alert handshake failure)
    Testing DHE-DSS-AES256-GCM-SHA384...NO (sslv3 alert handshake failure)
    Testing DH-RSA-AES256-GCM-SHA384...NO (sslv3 alert handshake failure)
    Testing DHE-RSA-AES256-GCM-SHA384...NO (sslv3 alert handshake failure)
    Testing DHE-RSA-AES256-SHA256...NO (sslv3 alert handshake failure)
    Testing DHE-DSS-AES256-SHA256...NO (sslv3 alert handshake failure)
    Testing DH-RSA-AES256-SHA256...NO (sslv3 alert handshake failure)
    Testing DH-DSS-AES256-SHA256...NO (sslv3 alert handshake failure)
    Testing DHE-RSA-AES256-SHA...NO (sslv3 alert handshake failure)
    Testing DHE-DSS-AES256-SHA...NO (sslv3 alert handshake failure)
    Testing DH-RSA-AES256-SHA...NO (sslv3 alert handshake failure)
    Testing DH-DSS-AES256-SHA...NO (sslv3 alert handshake failure)
    Testing DHE-RSA-CAMELLIA256-SHA...NO (sslv3 alert handshake failure)
    Testing DHE-DSS-CAMELLIA256-SHA...NO (sslv3 alert handshake failure)
    Testing DH-RSA-CAMELLIA256-SHA...NO (sslv3 alert handshake failure)
    Testing DH-DSS-CAMELLIA256-SHA...NO (sslv3 alert handshake failure)
    Testing AECDH-AES256-SHA...NO (sslv3 alert handshake failure)
    Testing ADH-AES256-GCM-SHA384...NO (sslv3 alert handshake failure)
    Testing ADH-AES256-SHA256...NO (sslv3 alert handshake failure)
    Testing ADH-AES256-SHA...NO (sslv3 alert handshake failure)
    Testing ADH-CAMELLIA256-SHA...NO (sslv3 alert handshake failure)
    Testing ECDH-RSA-AES256-GCM-SHA384...NO (sslv3 alert handshake failure)
    Testing ECDH-ECDSA-AES256-GCM-SHA384...NO (sslv3 alert handshake failure)
    Testing ECDH-RSA-AES256-SHA384...NO (sslv3 alert handshake failure)
    Testing ECDH-ECDSA-AES256-SHA384...NO (sslv3 alert handshake failure)
    Testing ECDH-RSA-AES256-SHA...NO (sslv3 alert handshake failure)
    Testing ECDH-ECDSA-AES256-SHA...NO (sslv3 alert handshake failure)
    Testing AES256-GCM-SHA384...NO (sslv3 alert handshake failure)
    Testing AES256-SHA256...NO (sslv3 alert handshake failure)
    Testing CAMELLIA256-SHA...NO (sslv3 alert handshake failure)
    Testing PSK-AES256-CBC-SHA...NO (no ciphers available)
    Testing ECDHE-ECDSA-AES128-GCM-SHA256...NO (sslv3 alert handshake failure)
    Testing ECDHE-ECDSA-AES128-SHA256...NO (sslv3 alert handshake failure)
    Testing ECDHE-ECDSA-AES128-SHA...NO (sslv3 alert handshake failure)
    Testing SRP-DSS-AES-128-CBC-SHA...NO (no ciphers available)
    Testing SRP-RSA-AES-128-CBC-SHA...NO (no ciphers available)
    Testing SRP-AES-128-CBC-SHA...NO (no ciphers available)
    Testing DH-DSS-AES128-GCM-SHA256...NO (sslv3 alert handshake failure)
    Testing DHE-DSS-AES128-GCM-SHA256...NO (sslv3 alert handshake failure)
    Testing DH-RSA-AES128-GCM-SHA256...NO (sslv3 alert handshake failure)
    Testing DHE-RSA-AES128-GCM-SHA256...NO (sslv3 alert handshake failure)
    Testing DHE-RSA-AES128-SHA256...NO (sslv3 alert handshake failure)
    Testing DHE-DSS-AES128-SHA256...NO (sslv3 alert handshake failure)
    Testing DH-RSA-AES128-SHA256...NO (sslv3 alert handshake failure)
    Testing DH-DSS-AES128-SHA256...NO (sslv3 alert handshake failure)
    Testing DHE-RSA-AES128-SHA...NO (sslv3 alert handshake failure)
    Testing DHE-DSS-AES128-SHA...NO (sslv3 alert handshake failure)
    Testing DH-RSA-AES128-SHA...NO (sslv3 alert handshake failure)
    Testing DH-DSS-AES128-SHA...NO (sslv3 alert handshake failure)
    Testing DHE-RSA-SEED-SHA...NO (sslv3 alert handshake failure)
    Testing DHE-DSS-SEED-SHA...NO (sslv3 alert handshake failure)
    Testing DH-RSA-SEED-SHA...NO (sslv3 alert handshake failure)
    Testing DH-DSS-SEED-SHA...NO (sslv3 alert handshake failure)
    Testing DHE-RSA-CAMELLIA128-SHA...NO (sslv3 alert handshake failure)
    Testing DHE-DSS-CAMELLIA128-SHA...NO (sslv3 alert handshake failure)
    Testing DH-RSA-CAMELLIA128-SHA...NO (sslv3 alert handshake failure)
    Testing DH-DSS-CAMELLIA128-SHA...NO (sslv3 alert handshake failure)
    Testing AECDH-AES128-SHA...NO (sslv3 alert handshake failure)
    Testing ADH-AES128-GCM-SHA256...NO (sslv3 alert handshake failure)
    Testing ADH-AES128-SHA256...NO (sslv3 alert handshake failure)
    Testing ADH-AES128-SHA...NO (sslv3 alert handshake failure)
    Testing ADH-SEED-SHA...NO (sslv3 alert handshake failure)
    Testing ADH-CAMELLIA128-SHA...NO (sslv3 alert handshake failure)
    Testing ECDH-RSA-AES128-GCM-SHA256...NO (sslv3 alert handshake failure)
    Testing ECDH-ECDSA-AES128-GCM-SHA256...NO (sslv3 alert handshake failure)
    Testing ECDH-RSA-AES128-SHA256...NO (sslv3 alert handshake failure)
    Testing ECDH-ECDSA-AES128-SHA256...NO (sslv3 alert handshake failure)
    Testing ECDH-RSA-AES128-SHA...NO (sslv3 alert handshake failure)
    Testing ECDH-ECDSA-AES128-SHA...NO (sslv3 alert handshake failure)
    Testing AES128-SHA256...NO (sslv3 alert handshake failure)
    Testing SEED-SHA...NO (sslv3 alert handshake failure)
    Testing CAMELLIA128-SHA...NO (sslv3 alert handshake failure)
    Testing PSK-AES128-CBC-SHA...NO (no ciphers available)
    Testing ECDHE-RSA-RC4-SHA...NO (sslv3 alert handshake failure)
    Testing ECDHE-ECDSA-RC4-SHA...NO (sslv3 alert handshake failure)
    Testing AECDH-RC4-SHA...NO (sslv3 alert handshake failure)
    Testing ADH-RC4-MD5...NO (sslv3 alert handshake failure)
    Testing ECDH-RSA-RC4-SHA...NO (sslv3 alert handshake failure)
    Testing ECDH-ECDSA-RC4-SHA...NO (sslv3 alert handshake failure)
    Testing RC4-SHA...NO (sslv3 alert handshake failure)
    Testing RC4-MD5...NO (sslv3 alert handshake failure)
    Testing PSK-RC4-SHA...NO (no ciphers available)
    Testing ECDHE-RSA-DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing ECDHE-ECDSA-DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing SRP-DSS-3DES-EDE-CBC-SHA...NO (no ciphers available)
    Testing SRP-RSA-3DES-EDE-CBC-SHA...NO (no ciphers available)
    Testing SRP-3DES-EDE-CBC-SHA...NO (no ciphers available)
    Testing EDH-RSA-DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing EDH-DSS-DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing DH-RSA-DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing DH-DSS-DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing AECDH-DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing ADH-DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing ECDH-RSA-DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing ECDH-ECDSA-DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing DES-CBC3-SHA...NO (sslv3 alert handshake failure)
    Testing PSK-3DES-EDE-CBC-SHA...NO (no ciphers available)
    Testing ECDHE-RSA-NULL-SHA...NO (sslv3 alert handshake failure)
    Testing ECDHE-ECDSA-NULL-SHA...NO (sslv3 alert handshake failure)
    Testing AECDH-NULL-SHA...NO (sslv3 alert handshake failure)
    Testing ECDH-RSA-NULL-SHA...NO (sslv3 alert handshake failure)
    Testing ECDH-ECDSA-NULL-SHA...NO (sslv3 alert handshake failure)
    Testing NULL-SHA256...NO (sslv3 alert handshake failure)
    Testing NULL-SHA...NO (sslv3 alert handshake failure)
    Testing NULL-MD5...NO (sslv3 alert handshake failure)
    ssllab's ssltest reports that IE11 uses TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 on Win7 and TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 on Win10.

    The problem for Schannel on XP is that this particular server advertises support for TLS 1.2 only and no fallback to 1.1 or 1.0 is allowed. Probably allowing TLS 1.2 (and TLS 1.1) in the Schannel's registry settings might help.

    Try merging this .reg file (reboot required)

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SYSTEM\WPA\PosReady] 
    "Installed"=dword:00000001
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client]
    "DisabledByDefault"=dword:00000000
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server]
    "DisabledByDefault"=dword:00000000
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]
    "DisabledByDefault"=dword:00000000
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server]
    "DisabledByDefault"=dword:00000000
    Edit: This will probably need KB4019276 installed on the machine beforehand.

    cheers,
    </wqw>

  31. #31
    Junior Member
    Join Date
    May 2018
    Posts
    22

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Schmidt, thank you. The test was unsuccessful. Does RC5 have the function of FTP upload and download with password?

  32. #32

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by yinxiaodan View Post
    Does RC5 have the function of FTP upload and download with password?
    No FTP-Upload-feature is encapsulated in a convenience-class, no...

    For the Download-direction though, you could try the cDownloads-Class (just tested this again on Win10 with my own FTP-server successfully):
    Code:
    Option Explicit
    
    Private WithEvents DLs As cDownloads
    
    Private Sub Form_Load()
      Dim Host: Host = "MyHostDomain.de"
      Dim Path: Path = "/pdf/SomePdfFile.pdf"
    
      Set DLs = New_c.Downloads
          DLs.Download "ftp://" & Host & Path, dl_FTP, , , "MyUsername", "MyPassword"
    End Sub
    
    Private Sub DLs_DownloadStart(DownloadObj As cDownload)
      Debug.Print "DL-Start with URL: " & DownloadObj.URL
    End Sub
    
    Private Sub DLs_DownloadProgress(DownloadObj As cDownload, ByVal Percent As Single, ByVal StatusCode As Long, StatusDescription As String, StatusValue As String)
      Debug.Print "DL-Progress with URL: " & DownloadObj.URL, Percent, StatusCode, StatusDescription, StatusValue
    End Sub
    
    Private Sub DLs_DownloadComplete(DownloadObj As cDownload, ByVal ErrNum As Long, ErrString As String)
      Debug.Print "DL-Complete with URL: " & DownloadObj.URL, ErrNum, ErrString, DownloadObj.GetContentLen
    End Sub
    Note, that the cDownloads-Class is not a "full FTP-Client" (it's "true to its name" - and does only downloads...
    e.g. it does not support Dir-Listings - and so you will have to know the Filename and Path beforehand on your FTP-Server).

    FWIW - I've uploaded a fully implemented FTP-Client of mine here:
    http://www.vbforums.com/showthread.p...n-Winsock-ocx)
    This is > 20 years old code, based on the Winsock.ocx - but with full control over the FTP-command-channel -
    Maybe that helps already - but it's surely not the only VB6-FTP-client-implementation when you google a bit...

    In case you need this for your own WebHosting (to synchronize between local Files and your production-environment)...
    the first thing I've done on my own WebHost was, to implement appropriate *.asp-Scripts, which allowed me Dir-Listings and File-Transfers directly and secure via https.

    So, personally I try to avoid FTP-stuff as often as I can - it's old-fashioned - and only secure with extensions like FTPS or SFTP -
    and firewall-wise always a nightmare to "configure and make work" at some customer.sites (especially when some customers have thrown Proxies into the mix in addition).

    Olaf

  33. #33
    Junior Member
    Join Date
    May 2018
    Posts
    22

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    I admire your selfless efforts. RC5 has made my programming much easier and helped me tremendously. Do you have a follow-up upgrade plan? It is suggested that donation portals can be set up on your website if possible, so that RC5 can develop better. Thank you again, Olaf.

  34. #34
    Junior Member
    Join Date
    May 2018
    Posts
    22

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    In addition, VB6 to control file upload and download, what is a good way to achieve fast and asynchronous execution?

  35. #35

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,255

    Re: VB6 Simple Async-Download-Ctl for multiple Files

    Quote Originally Posted by yinxiaodan View Post
    RC5 has made my programming much easier and helped me tremendously.
    Do you have a follow-up upgrade plan?
    There is not much missing in the RC5 currently (aside from perhaps a few classes, which wrap libCURL -
    or some other platform-independent "web-protocol-access-lib" - with the goal to get independent from the MS-inet-stack)

    Quote Originally Posted by yinxiaodan View Post
    In addition, VB6 to control file upload and download, what is a good way to achieve fast and asynchronous execution?
    Upload- and Download to WebServers?
    Using what protocol?

    If it's "Web-Servers" and http/https...:
    - the Download-direction is usually easy (e.g. for static files, no special serverside script is needed)
    - whereas for Uploads you will need appropriate serverside scripts, which handle the incoming "raw-file-data" (which can be send in several different formats).

    Olaf

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