|
本帖最后由 cai1234 于 2010-5-13 14:23 编辑
如果的ftp服务器的地址为192.168.1.1,用户名和密码都是123,文夹a下有许多文件,如何下载本地磁盘d的a文件夹下.找了相关的脚本,如何修改下面的脚本
#Include <WinINet.au3>
; Initialize WinINet
_WinINet_Startup()
; Set variables
Global $sServerName = ""
Global $iServerPort = 21
Global $sUsername = Default
Global $sPassword = Default
Global $sDirectory = "/"
Global $sFilenameFilter = "*"
; Create handles
Global $hInternetOpen = _WinINet_InternetOpen("AutoIt/" & @AutoItVersion)
Global $hInternetConnect = _WinINet_InternetConnect($hInternetOpen, $INTERNET_SERVICE_FTP, $sServerName, $iServerPort, 0, $sUsername, $sPassword)
; Enumerate directory files
If _WinINet_FtpSetCurrentDirectory($hInternetConnect, $sDirectory) Then
Global $avFtpFile = _WinINet_FtpFindFirstFile($hInternetConnect, $sFilenameFilter)
While Not @error
ConsoleWrite(DllStructGetData($avFtpFile[1], "FileName") & @CRLF)
_WinINet_InternetFindNextFile($avFtpFile[0], DllStructGetPtr($avFtpFile[1]))
WEnd
EndIf
; Cleanup
_WinINet_InternetCloseHandle($hInternetConnect)
_WinINet_InternetCloseHandle($hInternetOpen)
_WinINet_Shutdown() |
|