回复1楼,呃,不是有示例的么?返回的不是一个字符串,而是一个集合啊
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