找回密码
 加入
搜索
查看: 2562|回复: 3

[AU3基础] 关于FTP下载全部文件的问题

[复制链接]
发表于 2010-9-7 22:33:36 | 显示全部楼层 |阅读模式
弄了蛮就还是只下得单个文件,附源码希望高手指教下


#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#include <ftpex.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("上下工具", 331, 114, 232, 120)
$Input1 = GUICtrlCreateInput("", 0, 16, 329, 21)
$Button2 = GUICtrlCreateButton("上传", 31, 72, 65, 33)
$Button3 = GUICtrlCreateButton("下载", 142, 72, 65, 33)
$Button4 = GUICtrlCreateButton("退出", 252, 72, 65, 33)
$Progress1 = GUICtrlCreateProgress(0, 48, 329, 9)
GUISetState(@SW_SHOW)
$server = '192.168.1.9'
$username = '1'
$pass = '1'

#EndRegion ### END Koda GUI section ###
Local $nMsg
While 1
        $nMsg = GUIGetMsg()
        Select
                Case $nMsg = $Button4
                        Exit
                Case $nMsg = $GUI_EVENT_CLOSE
                        Exit
                       
        Case $nmsg =$Button2
$var = FileSelectFolder("选择一个文件夹.", "")
       GUICtrlSetData($Input1, $var)
$full_path = GUICtrlRead($Input1)
If($full_path=="") Then
ContinueLoop
EndIf

$Open = _FTP_Open('MyFTP Control')
$Conn = _FTP_Connect($Open, $server, $username, $pass)
$Ftpp = _FTP_DirPutContents($Conn,$var,"",1)
$Ftpc = _FTP_Close($Open)

MsgBox(4096,"恭喜你","上传成功",3)

  

   Case $nmsg = $Button3
$var = FileSelectFolder("选择一个文件夹.", "")
                        GUICtrlSetData($Input1, $var)
$full_path = GUICtrlRead($Input1)
If($full_path=="") Then
ContinueLoop
EndIf

$Open = _FTP_Open('MyFTP Control')
$Conn = _FTP_Connect($Open, $server, $username, $pass)
$huo = _FTP_DirGetCurrent($conn)
$ftpd = _FTP_FileGet($Conn,$huo & "\Autoit3CHS.rar",$var & "\Autoit3CHS.rar",1)
$Ftpc = _FTP_Close($Open)          

MsgBox(4096,"恭喜你","下载成功",3)


      
   
        EndSelect
WEnd
发表于 2010-9-7 23:24:40 | 显示全部楼层
关注中。。。
 楼主| 发表于 2010-9-17 22:13:59 | 显示全部楼层
路过不放过
发表于 2010-9-18 16:41:18 | 显示全部楼层
由FTP_FindFileFirst  ftp_findfilenext取得ftp中所有文件名然后一一取的?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-23 18:10 , Processed in 0.085868 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表