VB6.0中使用iNET控件,如果取得ftp中指定目录下的所有文件名?With Inet1
        .URL = "ftp://" & FTP_Url
        .Protocol = 2
        .RemotePort = 21
        .UserName = FTP_UserName
        .Password = FTP_PassWord        '请在这里补充代码,谢谢        Do While Inet1.StillExecuting '等待请求结束
           DoEvents
        Loop
        .Execute , "CLOSE"
End With在线等,期待高人指点,3Q啊

解决方案 »

  1.   


    Private Sub Form_Load()
       Dim FTP_IPAddress As String
       Dim FTP_Port As Integer
       Dim FTP_UserName As String
       Dim FTP_PassWord As String   FTP_IPAddress = "127.0.0.1"
       FTP_Port = 21
       FTP_UserName = "admin"
       FTP_PassWord = "1234567"
       
       With Inet1
          .Protocol = 2
          .RemoteHost = FTP_IPAddress
          .RemotePort = FTP_Port
          .UserName = FTP_UserName
          .Password = FTP_PassWord
          .Execute
       End With
    End Sub
    Private Sub Inet1_StateChanged(ByVal State As Integer)
       If State = 12 Then
          MsgBox Inet1.GetChunk(1024, icString)
       End If
    End Sub
      

  2.   

    非常感谢这位大哥,为什么这些资料我都找不到呢?比如GetChunk(Size,DateType)中的DateType有哪些语法我都不懂,唉,惭愧呀
      

  3.   

    您好,我下面的语句怎么获取一句字符串? 
    Private Sub Inet1_StateChanged(ByVal State As Integer) 
    On Error Resume Next 
    Dim I As String, J As String Select Case State 
    Case 11 
    RaiseEvent GetOK(-1, "") 
    Exit Sub 
    Case 12 
    Do '开始接受数据0 
    I = Inet1.GetChunk(255, icString) 
    If Len(I) = 0 Then Exit Do 
    J = J & I '接受到的所有数据存放在变量网页代码$中 
    Loop 
    RaiseEvent GetOK(1, J) 
    End Select 
    End Sub