|
#Include <FTPEx.au3>
$targetdir = "d:\123"
$txtfile = "d:\123\result.txt"
RunWait(@ComSpec&" /c dir /b """&$targetdir&""">"""&$txtfile&"""","",@SW_HIDE)
$arr=StringSplit(FileRead($txtfile),@CRLF,1)
$2=$arr[$arr[0]-1]
$server = "192.168.0.4" ;FTP地址
$username = "sqljy" ;FTP用户名
$pass = "sqljy" ;FTP密码
$FTPport = "12358" ;FTP端口号
$Open = _FTP_Open("MyFTP Control") ;打开FTP服务器会话,名字任意
$Conn = _FTP_Connect($Open, $server,$username,$pass ,1, $FTPport)
;创建FTP服务器连接,默认端口是21
$Ftpd = _FTP_FilePut($Conn, $2,"","","") ;创建FTP服务器目录
$FTPdir = _FTP_DirSetCurrent($Conn,"") ;设置FTP服务器当前目录
$Ftpc = _FTP_Close($Open) ;关闭FTP服务器连接
文件无法上传FTP |
|