1、递归,这样你就能得到所有的文件路径
内部函数 listfile
Dim pth As String = args(0)
Dim nms As List(of String) = args(1)
For Each fl As String In filesys.GetFiles(pth)
nms.add(fl)
Next
For Each dr As String In FileSys.GetDirectories(pth)
Functions.Execute("listfile",dr.nms)
Next
调用函数:
dim nms As New List(of string)
Functions.Execute("listfile","c:\data",nms)
2、循环nms,然后做你想做的操作