眼眸繁星
这将是 Autoit 解决方案。;ftp- Upload#include <Array.au3>#include <File.au3>#include <MsgBoxConstants.au3>#include <FTPEx.au3>$initialPath = 'c:\Users\xxx\Downloads\'$fileStructure = _FileListToArrayRec($initialPath, '*', $FLTAR_FILESFOLDERS, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_FULLPATH);~ _ArrayDisplay($fileStructure)_Example()Func _Example() Local $sServer = '192.168.178.XXX' Local $sUsername = 'admin' Local $sPass = 'xxx' Local $Err, $sFTP_Message Local $hOpen = _FTP_Open('MyFTP Control') Local $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass, 0, 21, $INTERNET_SERVICE_FTP, $INTERNET_FLAG_PASSIVE) If @error Then MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR=' & @error) Else _FTP_GetLastResponseInfo($Err, $sFTP_Message) ConsoleWrite('$Err=' & $Err & ' $sFTP_Message:' & @CRLF & $sFTP_Message & @CRLF) ; do something ... _FTP_DirSetCurrent($hConn, '/ALL') _FTP_DirPutContents($hConn, $initialPath, '/ALL', 1) Sleep(100) _FTP_DirSetCurrent($hConn, '/ALL') Local $aFile = _FTP_ListToArray($hConn, 0) _ArrayDisplay($aFile) EndIf Local $iFtpc = _FTP_Close($hConn) Local $iFtpo = _FTP_Close($hOpen)EndFunc ;==>_Example