以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]大神帮我看下代码  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=65583)

--  作者:半人马座比邻星
--  发布时间:2015/3/18 16:36:00
--  [求助]大神帮我看下代码

For Each d1 As String In FileSys.GetDirectories("g:\\ce shi wen jian jia")
    Dim dr1 As DataRow = DataTables("表A").AddNew()
    dr1("第一列") = filesys.GetName(d1)
    For Each d2 As String In FileSys.GetDirectories(d1)
        Dim dr2 As DataRow = DataTables("表A").AddNew
        dr2("第二列") = filesys.GetName(d2)
        For Each d3 As String In FileSys.GetDirectories(d2)
            Dim dr3 As DataRow = DataTables("表A").AddNew()
            dr3("第三列") = filesys.GetName(d3)
            Dim a As String = ""
            Dim dr4 As DataRow = DataTables("表A").AddNew()
            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
            dr4("第四列") = a
            Next
        Next
        Dim b As String = ""
        Dim dr5 As DataRow = DataTables("表A").AddNew
        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
        dr5("第三列") = b
        Next
    Next
    Dim c As String = ""
    Dim dr6 As DataRow = DataTables("表A").AddNew
    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
    dr6("第二列") = c
    Next
Next
Dim d As String = ""
Dim dr7 As DataRow = DataTables("表A").AddNew
For Each f1 As String In filesys.GetFiles("g:\\ce shi wen jian jia")
    If d > "" Then
       d =  d & vbcrlf & filesys.GetName(f1)
    Else
       d = filesys.GetName(f1)
    End If
    dr7("第一列") = d
Next

 

 

 

 

运行后是图中这种情况,我想把黑圈中的单元格消掉,但不知从何着手


图片点击可在新窗口打开查看此主题相关图片如下:试运行1(4层).png
图片点击可在新窗口打开查看

--  作者:半人马座比邻星
--  发布时间:2015/3/18 16:38:00
--  

能否请大神指点一二,给个思路也行


--  作者:有点甜
--  发布时间:2015/3/18 16:45:00
--  

  还想跟你说多少次啊

 

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=63354&skin=0

 


--  作者:有点甜
--  发布时间:2015/3/18 16:54:00
--  
Dim dr As DataRow
For Each d1 As String In FileSys.GetDirectories("D:\\PDF")
    For Each d2 As String In FileSys.GetDirectories(d1)
        For Each d3 As String In FileSys.GetDirectories(d2)
            Dim a As String = ""
            dr = DataTables("表A").AddNew()
            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("第一列") = FileSys.GetName(d1)
            dr("第二列") = FileSys.GetName(d2)
            dr("第三列") = FileSys.GetName(d3)
            dr("第四列") = a
        Next
        Dim b As String = ""
        Dim dr2 As DataRow = DataTables("表A").AddNew
        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
        msgbox(3)
        dr("第一列") = FileSys.GetName(d1)
        dr("第二列") = FileSys.GetName(d2)
        dr("第三列") = b
    Next
    Dim c As String = ""
    dr = DataTables("表A").AddNew
    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
        dr("第一列") = FileSys.GetName(d1)
        dr("第二列") = c
    Next
Next
Dim d As String = ""
dr = DataTables("表A").AddNew
For Each f1 As String In filesys.GetFiles("D:\\PDF")
    If d > "" Then
        d =  d & vbcrlf & filesys.GetName(f1)
    Else
        d = filesys.GetName(f1)
    End If
    dr("第一列") = d
Next

--  作者:半人马座比邻星
--  发布时间:2015/3/18 17:05:00
--  

--  作者:半人马座比邻星
--  发布时间:2015/3/21 12:21:00
--  
再次求助,文件被列出来后打不开,说是未找到文件。我修改了列属性里的存放目录,但是每列只能有一个存放目录,而且存放目录必须精确到文件夹。同一列中不同行的文件就没办法同时打开了