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 flt = "/" & dr("目录") & "/" Dim dlg As New FolderBrowserDialog If dlg.ShowDialog = DialogResult.Ok Then MessageBox.Show("你选择的目录是:" & dlg.SelectedPath,"提示") For Each nd As WinForm.TreeNode In trv.AllNodes If nd.Checked = True Then ftp1.Download(flt & nd.text,dlg.SelectedPath & "/" & nd.Text) End If Next msgbox("下载完毕") End If End If
|