不理解你到底想做什么,获取每个文件夹下的文件?
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编辑过]