要使用递归
建一个自定义函数,假设名称为child,代码
dim ftp as FTPClient = args(0)
dim path as string = args(1)
Dim dls As List(Of String) = ftp.GetDetailList(path)
For Each dl As String In dls
Output.Show(dl)
If dl.EndsWith("*D") Then
Functions.Execute("child",ftp ,path & "\" & dl.split("*")(0))
End If
Next
命令窗口测试
Dim ftp As New FTPClient
Dim ip As String = Tables("网络设置").Current("地址")
Dim ac As String = Tables("网络设置").Current("帐号")
Dim pa As String = Tables("网络设置").Current("密码")
Dim po As String = Tables("网络设置").Current("端口")
ftp.Host = ip
ftp.Account = ac
ftp.Password = pa
ftp.Port = po
Dim path As String = "\2023"
Functions.Execute("child",ftp ,dl)
[此贴子已经被作者于2023/9/11 23:04:12编辑过]