各位大仙,关于Transfer控件传文件有关问题,来帮帮忙吧!先多谢啦.

各位大仙,关于Transfer控件传文件问题,来帮帮忙吧!先谢谢啦...
在我FTP服务器的 tooling/1044/ 文件夹下有这样几个文件:
  1044E17A10t01_a.txt
  1044E17A10t01_b.txt
  1044E17A10t01_c.txt
  1044E17A10t01_d.txt
  1044E17A10t01_e.txt
我用 Internet Transfer控件想把它们从FTP上下载到本地电脑上,我是这样写的:

Public sub Command1_click()
  Inet1.url=text1.text
  Inet1.execute,"CD tooling/1044/"
End Sub

Public sub Command2_click()
  Inet1.Execute,"GET 1044E17A10T01_a.txt F:\1044E17A10T01_a.txt"
End Sub

这样能下载成功!但是需两步,点两下,只能下载一个文件,我想点一下Command1就能把它们全都下载来.
Public sub Command1_click()
  Inet1.url=text1.text
  Inet1.execute,"CD tooling/1044/"
  Inet1.Execute,"GET 1044E17A10T01_a.txt F:\1044E17A10T01_a.txt"
End Sub
这样报警: 仍在执行上一个请求.

我这样写
  Public sub Command1_click()
  Inet1.url=text1.text
  Inet1.execute,"CD tooling/1044/"
  select case state
  case 12
  Inet1.Execute,"GET 1044E17A10T01_a.txt F:\1044E17A10T01_a.txt"
  end select
End Sub
  点一下也能把文件下载下来,但到最后还是报警:与主机通讯时产生错误.

还请各位大仙多多忙,感激不尽.谢谢...怎样才能把那几个文件批量下载呀.给点思路,或来个例子,谢谢各位[size=14px][/size]

------解决方案--------------------
参考这个
VB code
Private Sub cmd(cmdstr As String)
    Do
        If Inet1.StillExecuting = False Then Exit Do
    Loop
    ExeStr = cmdstr
    Done = False
    Debug.Print ExeStr; "="
    Inet1.Execute , ExeStr
    Do
        DoEvents
        If Done Then Exit Do
    Loop
End Sub
Public Sub ReadAFile(fn As String)
    Inet1.URL = "ftp://"
    Inet1.UserName = "username"
    Inet1.Password = "password"

    cmd "PWD"
    cmd "CD tooling/1044/"
    cmd "DIR"
    cmd "GET " + fn + " " + "F:\" + fn 
    cmd "QUIT"
End Sub

Private Sub Command1_Click()
    Command1.Enabled = False
    ReadAFile "1044E17A10T01_a.txt"
    Command1.Enabled = True
End Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim intFile As Integer
Dim vtData() As Byte
Dim str As String
'On Error GoTo ISCerr
    Debug.Print "State="; State,
    Select Case State
    Case 0
        Debug.Print "icNone"
    Case 1
        Debug.Print "icHostResolvingHost"
    Case 2
        Debug.Print "icHostResolved"
    Case 3
        Debug.Print "icConnecting"
    Case 4
        Debug.Print "icConnected"
    Case 5
        Debug.Print "icRequesting"
    Case 6
        Debug.Print "icRequestSent"
    Case 7
        Debug.Print "icReceivingResponse"
    Case 8
        Debug.Print "icResponseReceived"
        If Left(ExeStr, 2) = "CD" Then Done = True
    Case 9
        Debug.Print "icDisconnecting"
    Case 10
        Debug.Print "icDisconnected"
        Done = True
    Case 11
        Debug.Print "icError of [" + ExeStr + "]="; Inet1.ResponseInfo
        Done = True
    Case 12
        Debug.Print "icResponseCompleted----------------"
        Do
            str = Inet1.GetChunk(1024, icString)
            If LenB(str) = 0 Then Exit Do
            Debug.Print str
        Loop
        Done = True
    End Select
    Exit Sub
ISCerr:
    Resume Next
End Sub

------解决方案--------------------
探讨
#1 楼,
能不能给讲下呀....还是不懂呀...有没有简单一点的例子呀.

------解决方案--------------------
VB code
Public Sub ReadAllFile()
    Inet1.URL = "ftp://你的FTP服务器地址"
    Inet1.UserName = "username"
    Inet1.Password = "password"
    cmd "CD tooling/1044/"
    cmd "GET 1044E17A10T01_a.txt F:\1044E17A10T01_a.txt"
    cmd "GET 1044E17A10T01_b.txt F:\1044E17A10T01_b.txt"
    cmd "GET 1044E17A10T01_c.txt F:\1044E17A10T01_c.txt"
    cmd "GET 1044E17A10T01_d.txt F:\1044E17A10T01_d.txt"
    cmd "GET 1044E17A10T01_e.txt F:\1044E17A10T01_e.txt"
    cmd "QUIT"
End Sub