FileExists
判断指定的文件是否存在,语法:
FileExists(FileName)
FileName:要判断的文件名,含路径。
示例
Dim ftp1 As New FtpClient
ftp1.Host="196.128.143.28"
ftp1.Account = "foxuser"
ftp1.Password = "138238110"
If ftp1.FileExists("\photo\jz.png") Then '如果存在则下载
If ftp1.Download("\photo\jz.png","c:\data\jz.png") Then
messagebox.Show("下载完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
messagebox.Show("下载失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
messagebox.Show("此文件不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
http://www.foxtable.com/help/topics/1410.htm
以上是帮助的例子,可以判断文件是否存在.
类似你这种情况,建议重新命名文件名, 格式变动为 用户名_原本的文件名 这样就不会造成这个问题了.
[此贴子已经被作者于2013-12-23 8:58:54编辑过]