Foxtable(狐表)用户栏目专家坐堂 → [求助]大神帮我看下,笨死我算了


  共有3825人关注过本帖树形打印复制链接

主题:[求助]大神帮我看下,笨死我算了

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/1/19 14:44:00 [显示全部帖子]

 不理解你到底想做什么,获取每个文件夹下的文件?

 

For Each d1 As String In FileSys.GetDirectories("g:\ce shi wen jian jia")
    Dim dr As DataRow = DataTables("表A").AddNew()
    For Each d2 As String In FileSys.GetDirectories(d1)
        For Each d3 As String In FileSys.GetDirectories(d2)
            Dim a As String = ""
            For Each f4 As String In filesys.GetFiles(d3)
                If a > "" Then
                    a =  a & vbcrlf & filesys.GetName(f4)
                Else
                    a = filesys.GetName(f4)
                End If
               
            Next
            dr("第四列") = a
        Next
        Dim b As String = ""
        For Each f3 As String In filesys.GetFiles(d2)
            If b > "" Then
                b =  b & vbcrlf & filesys.GetName(f3)
            Else
                b = filesys.GetName(f3)
            End If
           
        Next
        dr("第三列") = b
    Next
    Dim c As String = ""
    For Each f2 As String In filesys.GetFiles(d1)
        If c > "" Then
            c =  c & vbcrlf & filesys.GetName(f2)
        Else
            c = filesys.GetName(f2)
        End If
    Next
    dr("第二列") = c
Next
For Each f1 As String In filesys.GetFiles("g:\ce shi wen jian jia")
    Dim d As String = ""
    Dim dr As DataRow = DataTables("表A").AddNew
    If d > "" Then
        d =  d & vbcrlf & filesys.GetName(f1)
    Else
        d = filesys.GetName(f1)
    End If
    dr("第一列") = d
Next

[此贴子已经被作者于2015-1-19 14:45:35编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/1/19 14:55:00 [显示全部帖子]

 

For Each d1 As String In FileSys.GetDirectories("g:\ce shi wen jian jia")
    Dim dr As DataRow = DataTables("表A").AddNew()
    dr("第一列") = d1
    For Each d2 As String In FileSys.GetDirectories(d1)
        dr("第二列") = d2
        For Each d3 As String In FileSys.GetDirectories(d2)
            dr("第三列") = d3
            Dim a As String = ""
            For Each f4 As String In filesys.GetFiles(d3)
                If a > "" Then
                    a =  a & vbcrlf & filesys.GetName(f4)
                Else
                    a = filesys.GetName(f4)
                End If
               
            Next
            dr("第四列") = a
        Next
    Next
Next

 


 回到顶部