#include "CoProc.au3"
#include <FTPEx.au3>
$Form1 = GUICreate("FTP上传文件")
$Button1 = GUICtrlCreateButton("上传",-1,-1)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button1
_CoProc("FTP_UP")
EndSwitch
WEnd
Func FTP_UP()
Local $server = '127.0.0.1'
Local $username = 'test'
Local $pass = 'test'
Local $Open = _FTP_Open('MyFTP')
Local $Conn = _FTP_Connect($Open, $server, $username, $pass)
Local $Ftpp = _FTP_FilePut($Conn,'c:\1.txt','a.txt')
_FTP_Close($Open)
EndFunc
|