If (fso.FileExists(filespec)) Then msg = filespec & " 存在。" Else msg = filespec & " 不存在。" End If
我这样写怎么还是不行呢,麻烦帮我看一下,谢谢! Inet1.URL = "ftp://username:[email protected]" Inet1.Protocol = 2 Inet1.RemoteHost = "192.168.0.3" Inet1.RemotePort = 21 Inet1.UserName = "123" Inet1.Password = "123" If fso.FileExists("ftp://192.168.0.2/abc.txt") Then Open "ftp://192.168.0.2/abc.txt" For Input As #7 '打开文件 End If
<a href="http://blog.csdn.net/z_wenqian/archive/2011/04/28/6368901.aspx">http://blog.csdn.net/z_wenqian/archive/2011/04/28/6368901.aspx</a>
inet1.Protocol=2-icFTP
inet1.RemoteHost=hostname
inet1.RemotePort=21
inet1.Username=username
inet1. Password=password
msg = filespec & " 存在。"
Else
msg = filespec & " 不存在。"
End If
Inet1.Protocol = 2
Inet1.RemoteHost = "192.168.0.3"
Inet1.RemotePort = 21
Inet1.UserName = "123"
Inet1.Password = "123"
If fso.FileExists("ftp://192.168.0.2/abc.txt") Then
Open "ftp://192.168.0.2/abc.txt" For Input As #7 '打开文件
End If
比如你打开“http://www.csdn.net/12345678.txt”返回404就表示文件不存在
我用的是自己的主机当的虚拟服务器,我确定那个文件是存在的,但是在VB程序里面就会报错。