为什么提取的文件名缺了很多?即提取的文件名不完整
单击事件:
Dim Book As New XLS.Book '定义一个Excel工作簿
Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表
Sheet(0, 0).Value = "文件名"
Dim r As Integer = 1
Dim FilePath As WinForm.TextBox = e.Form.Controls("TextBox1")
If FileSys.DirectoryExists(FilePath.Value) Then
Functions.Execute("文件名提取函数", FilePath.Text, Sheet, r)
End If
Book.Save("c:\reports\test.xls")
递归函数:
Dim path As String = args(0)
Dim Sheet As XLS.Sheet = args(1)
Dim r As Integer = args(2)
For Each file As String In FileSys.GetFiles(path)
Dim Ifo As new FileInfo(file)
If Ifo.hidden=False Then
sheet(r,0).value = file
r += 1
End If
Next
For Each p As String In FileSys.GetDirectories(path)
Functions.Execute("文件名提取函数", p, Sheet, r)
Next