http://www.foxtable.com/help/topics/1410.htm
GetFileList
用于返回FTP服务器指定目录下的全部文件名,以字符串集合的形式返回,语法:
GetFileList(Path)
Path:可选参数,用于指定目录,如果省略,则返回当前目录下的全部文件名。
示例
例如列出photo目录下的所有文件:
Dim ftp1 As New FtpClient
Dim fls As List(of String)
ftp1.Host="196.128.143.28"
ftp1.Account = "foxuser"
ftp1.Password = "138238110"
fls = ftp1.GetFileList("\photo")
For Each fl As String In fls
Output.Show(fl)
Next
还可以使用通配符,例如列出photo目录下的所有jpg文件:
Dim ftp1 As New FtpClient
Dim fls As List(of String)
ftp1.Host="196.128.143.28"
ftp1.Account = "foxuser"
ftp1.Password = "138238110"
fls = ftp1.GetFileList("\photo\*.jpg")
For Each fl As String In fls
Output.Show(fl)
Next
GetDirList
用于返回FTP服务器指定目录下的全部子目录,以字符串集合的形式返回,语法:
GetDirList(Path)
Path:可选参数,用于指定目录,如果省略,则返回当前目录下的全部子目录名。
示例
Dim ftp1 As New FtpClient
Dim dls As List(of String)
ftp1.Host="196.128.143.28"
ftp1.Account = "foxuser"
ftp1.Password = "138238110"
dls = ftp1.GetDirList("\photo")
For Each dl As String In dls
Output.Show(dl)
Next