Need VB6 Help, API Download

Discussion in 'Programming' started by Coopzie, Jul 3, 2008.

  1. #1
    Two Problems,
    1. The files download at once, need them to download one at a time.
    2. Need a two minute delay between each download.

    Private Sub Form_Load()
    Dim tmp() As String
    Dim i As Integer
    Open App.Path & "\links.txt" For Input As #1
        tmp() = Split(Input(LOF(1), 1), vbCrLf)
    For i = 0 To UBound(tmp)
    DL.Download tmp(i), App.Path & "\" & ExtractFileName(tmp(i)), "k" & i
    Label2.Caption = "Connecting..."
    Next i
    Close #1
    End Sub
    Code (markup):

     
    Coopzie, Jul 3, 2008 IP
  2. nhl4000

    nhl4000 Well-Known Member

    Messages:
    479
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Private Sub Form_Load()
    Dim tmp() As String
    Dim i As Integer
    Open App.Path & "\links.txt" For Input As #1
        tmp() = Split(Input(LOF(1), 1), vbCrLf)
    For i = 0 To UBound(tmp)
    DL.Download tmp(i), App.Path & "\" & ExtractFileName(tmp(i)), "k" & i
    Label2.Caption = "Connecting..."
    tmrWait.Enabled = True
    Do Until tmrWait.Enabled = False
    DoEvents
    Loop
    Next i
    Close #1
    End Sub
    Code (markup):
    Make tmrWait Interval to two minutes and when it ticks, make tmrWait.Enabled = False
    I'm not sure what control is DL, but have a small loop after that until DL is finish...like...

    DL.Download tmp(i), App.Path & "\" & ExtractFileName(tmp(i)), "k" & i
    Do until DL.IsBusy = False 'or something like that, just look at its properties
    DoEvents
    Loop
    Code (markup):
     
    nhl4000, Jul 3, 2008 IP