为了获取单元格中的所有文件名,看我绕了多大的圈子啊……惭愧!
Dim ftp1 As New FtpClient
ftp1.Host="47.91.11.151"
ftp1.Account = "ftpuser"
ftp1.Password = "ftp@163"
ftp1.RootDir = _xmml & "/附件区"
Dim fm As WinForm.FileManager = e.Form.Controls("FileManager2")
fm.FTPclient = ftp1
Dim r As Row = Tables("文档表").Current
Dim s As String = r("附件")
s = s.Replace(chr(13),"*")
s = s.Replace(chr(10),"")
Dim val() As String = s.Split("*")
Dim vs As new List(of String)
vs.AddRange(val)
For Each v As String In vs
Dim fl As String = FileSys.GetName(v)
' output.show(fl)
Dim file As String = _xmml & "\附件区\" & fl
If ftp1.FileExists(file) Then '如果存在则删除
If ftp1.DeleteFile(file) = True Then '这里要带路径的
Messagebox.show("ftp文档" & fl & "删除成功!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
fm.DeleteFile(fl) '这里是不带路径的
Else
Messagebox.show("ftp文档" & fl & "删除失败,请管理员手动删除!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
messagebox.Show("ftp文档" & fl & "不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Next
[此贴子已经被作者于2019/7/29 4:17:50编辑过]