以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  FTP 服务器  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=61999)

--  作者:freeants
--  发布时间:2014/12/23 20:52:00
--  FTP 服务器
ftp1.Host=GetConfigValue("IP" & i,"")
ftp1.Account = GetConfigValue("用户名" & i,"")
ftp1.Password = GetConfigValue("密码" & i,"")
ftp1.RootDir = GetConfigValue("根目录" & i,"")
ftp1.UTF8 = True
If ftp1.DirExists(GetConfigValue("当前目录" & i,"")) Or ftp1.MakeDir(GetConfigValue("当前目录" & i,"")) Then
Else
    MessageBox.show("FTP服务器不存在当前文件夹,并且无法创建!")
    Return
End If
ftp1.ChangeDir(GetConfigValue("当前目录" & i,""))

If Functions.Execute("连接测试",ftp1.host) Then
    If ftp1.Connected Or (ftp1.Connected=False AndAlso ftp1.Connect) Then 
   end if

end if 

以上代码在运行中,不知道运行到 那个 代码,就 已经 连接到 FTP 服务器了

--  作者:freeants
--  发布时间:2014/12/23 20:53:00
--  
ftp1.RootDir = GetConfigValue("根目录" & i,"")  还是 ftp1.DirExists(GetConfigValue("当前目录" & i,"")) 
--  作者:有点甜
--  发布时间:2014/12/23 20:54:00
--  
执行操作的时候 DirExists 才会连接。
--  作者:有点甜
--  发布时间:2014/12/23 20:55:00
--  

Connect 连接

 

Close 关闭