以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  求助:下载FTP上文件夹中的所有文件  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=142560)

--  作者:cxmxjwlmq
--  发布时间:2019/10/30 21:49:00
--  求助:下载FTP上文件夹中的所有文件

 各位老师:我想下载\\更新文件\\Attachments\\的所有文件,但这段代码中标红的这句没有执行!

 

If  ftp1.DirExists("\\更新文件\\Attachments") Then 
      MessageBox.show("目录已经存在","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
      ftp1.Download("\\更新文件\\Attachments\\", ProjectPath & "\\Attachments\\")  ‘没有执行
 Else
      MessageBox.show("不存在","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
 End If

 

请各位老师指点一下,标红的代码怎么修改一下,能下载attachments文件夹下的所有文件!

请费心,谢谢!


--  作者:有点蓝
--  发布时间:2019/10/31 8:43:00
--  
dim fls = ftp1.GetFileList("\\更新文件\\Attachments")
For Each fl As String In fls
    Dim d As String = FileSys.GetName(fl)
    ftp1.Download(fl, ProjectPath & "Attachments\\" & d)
Next
[此贴子已经被作者于2019/10/31 8:42:58编辑过]

--  作者:cxmxjwlmq
--  发布时间:2019/10/31 9:38:00
--  

谢谢老师指点!