内部函数,函数名:递归,代码:
Dim path As String = args(0)
Dim ls As List(of String) = args(1)
For Each file As String In FileSys.GetFiles(path)
Dim finfo As new FileInfo(file)
If finfo.Hidden = False Then
ls.add(file)
End If
Next
For Each p As String In FileSys.GetDirectories(path)
Dim s As new System.Security.AccessControl.DirectorySecurity(p, System.Security.AccessControl.AccessControlSections.Access)
If s.AreAccessRulesProtected = False Then
Functions.Execute("递归", p, ls)
End If
Next
调用测试:
Dim lst As new List(of String)
Functions.Execute("递归", "C:\foxtable\Development",lst)
MessageBox.show(lst.Count)
测试通过