本帖最后由 auto 于 2011-8-26 19:18 编辑
#include <FTPEx.au3>
#include <Array.au3>
$server = 'ftp.mozilla.org';ftp.mozilla.org' ;服务器
$name = '' ;用户名
$pass = '' ;密码
$Port = '21' ;端口
$path = "" ;路径
Global $pp[500]
ftp($server, $name, $pass, $Port, "")
Func ftp($server, $name, $pass, $Port, $path)
$Open = _FTP_Open('MyFTP') ;打开一个FTP会话
$Conn = _FTP_Connect($Open, $server, $name, $pass, 0, $Port) ;连接到ftp服务器
$t = _FTP_DirSetCurrent($Conn, $path)
ConsoleWrite($t&@TAB&$path&@CR)
$aFile = _FTP_ListToArrayEx($Conn, 0, 0) ;列目录(0=文件和目录,1=目录,2=文件)(格式0=mm/dd/yyyy,1=yyyy/mm/dd)
For $i = 1 To $aFile[0][0]
If $aFile[$i][2] = 16 And $aFile[$i][0] <> "." And $aFile[$i][0] <> ".." Then
$path = $path & $aFile[$i][0] & "/";
ftp($server, $name, $pass, $Port, $path)
EndIf
Next
$Ftpc = _FTP_Close($Open) ;关闭 _FTP_Open 打开的回话
EndFunc ;==>ftp
当调用自身程序完成时,好像值不对?不知道是哪个地方错了?? |