Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim ftp1 As New FTPClient
Dim dr As DataRow = DataTables("系统参数设置表").SQLFind("参数名称 = 'FTP地址'")
If dr IsNot Nothing Then
ftp1.Host= dr("设置值")
ftp1.Account = dr("用户名")
ftp1.Password = dr("密码")
ftp1.Port = dr("端口号")
ftp1.RootDir = "\" & dr("目录")
Dim s As String
Dim s1 As String
Dim flt As String
For Each nd As WinForm.TreeNode In trv.AllNodes
If nd.Checked = True Then
s = """" & nd.Text & """" & s
s1 = nd.Text & " " & s1
End If
Next
flt = "/" & dr("目录") & "/" & s1
Dim dlg As New SaveFileDialog
dlg.OverwritePrompt = True
dlg.FileName = s1 '''nd.text
If dlg.ShowDialog = DialogResult.Ok Then
If ftp1.Download(flt,dlg.FileName) Then
MessageBox.Show("下载成功")
End If
End If
End If
图中文件名字是使用目录树来实现的
请教一下,该如何实现下载目录上勾选的多个文件(单个文件下载是可以的),下载文件路径该如何写
此主题相关图片如下:企业微信截图_15048392966496.png