inet控件使用DIR命令查找文件夹后,如何在 State 事件中使用 GetChunk 方法获得目录信息!

解决方案 »

  1.   

    省略了一些
    Private Sub Listfile(DirStr As String)
    If Not Inet1.StillExecuting Then
        OperationStyle = 1
        Inet1.Execute , "LS " & DirStr
    End If
    End SubPrivate Sub Inet1_StateChanged(ByVal State As Integer)
    Select Case State
    Case 12 'icResponseCompleted
    Select Case OperationStyle
                Case 1 '列出目录和文件
                    InetData = Inet1.GetChunk(1024, 0) '0表示把数据作为字符串来检索,1表示把数据作为字节数组来检索
                    If Trim(InetData) <> 0 Then
                        tempArray = Split(InetData, vbCrLf, , vbTextCompare)
                        Combo2.Text = "Root/" & CurrentServerDir
                        i = 0
                        Do While i < UBound(tempArray)
                            If tempArray(i) <> "" Then
                                debug.print (tempArray(i))
                            End If
                            i = i + 1
                        Loop
                        ListIndex = 1
                    End If