以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- FTP不能列出所有文件 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=146553) |
-- 作者:lihe60 -- 发布时间:2020/2/26 12:46:00 -- FTP不能列出所有文件 不能列出目录下所有文件 Dim ftp1 As New FtpClient Dim fls As List(of String) ftp1.Host="" ftp1.Account = "foxtable" ftp1.Password = "" fls = ftp1.GetFileList("\\存货名称图片") For Each fl As String In fls Output.Show(fl) Next |
-- 作者:有点蓝 -- 发布时间:2020/2/26 14:00:00 -- 如果有子目录,需要递归进去处理,使用GetDirList获取目录,再逐一取子目录里的文件 Dim ftp1 As New FtpClient Dim fls As List(of String) ftp1.Host="" ftp1.Account = "foxtable" ftp1.Password = "" fls = ftp1.GetFileList("\\存货名称图片") For Each fl As String In fls Output.Show(fl) Next Dim fls2 As List(of String) = ftp1.GetDirList("\\存货名称图片")
For Each fl2 As String In fls2 fls = ftp1.GetFileList(fl2) For Each fl3 As String In fls Output.Show(fl3) Next Next |