效果不对,并没有删除为空的子目录。
Dim ftp As New FtpClient
Dim dls As List(of String)
ftp.Host="192.168.1.35"
ftp.Account = "tester"
ftp.Password = "tester"
Dim lj As String = "/待用户现场确认版本_产线禁止使用/2015/" & Tables("临时版本跟踪表").current("临时版本编号") & "(" & Tables("临时版本跟踪表").current("客户") & "_" & Tables("临时版本跟踪表").current("博达机型") & ")"
dls = ftp.GetDirList("lj")
msgbox(lj)-------已执行
For Each dl As String In dls
msgbox(dl)---未执行,应该是把dls中的每个元素都列出来才对。
If ftp.GetFileList(lj & "/" & dl).Count < 2 Then
ftp.DeleteDir(lj & "/" & dl)
End If --------这个if判断未删除为空的子目录。
Next
ftp.Close
Forms("FTP管理器").close