open 172.31.0.3
anonymous
slau.andre@gmail.com
binary
mkdir "ftp"
cd "ftp"
put "C:\DOCUME~1\Kefir\0016~1\ftp\1.png"
put "C:\DOCUME~1\Kefir\0016~1\ftp\2.png"
put "C:\DOCUME~1\Kefir\0016~1\ftp\9.jpg"
put "C:\DOCUME~1\Kefir\0016~1\ftp\PrScr.jpg"
mkdir ""
cd ""
put "C:\DOCUME~1\Kefir\0016~1\ftp\\config.ini"
put "C:\DOCUME~1\Kefir\0016~1\ftp\\DropFile.ahk"
put "C:\DOCUME~1\Kefir\0016~1\ftp\\DropFile.exe"
put "C:\DOCUME~1\Kefir\0016~1\ftp\\Quick'n Easy FTP Server v2.7.1 setup.exe"
cd ..
cd ..
quit
Borw|172.31.0.3|Username|MyPassword
Nout|172.31.0.4|anonymous|slau.andre@gmail.com
; - . \ #NoTrayIcon #NoEnv SendMode Input SetWorkingDir %A_ScriptDir% curr=%1% ; , if curr= ExitApp FTPCommandFile = %A_ScriptDir%\FTPCommands.txt ; FTPLogFile = %A_ScriptDir%\FTPLog.txt ; countf:=0 TSize:=0 FileDelete %FTPCommandFile% ; FileDelete %FTPLogFile% ; FileRead, conf, %A_ScriptDir%\config.ini ; conf n:=0 Loop, parse, conf,`n ; conf { i:=0 Loop, Parse, A_LoopField, | ; | { ; con%n%%i% = %A_LoopField% ; i++ } name:=con%n%0 ; . Menu, PopUp, Add, %name%, Who ;Who - n++ ; } i:=0 n:=0 Menu, PopUp, Show ; . ; ; , ; return Who: { item:=A_THISMENUITEMPOS-1 addr:=con%item%1 login:=con%item%2 pass:=con%item%3 FileAppend, open %addr%`n, %FTPCommandFile% ; ; FileAppend, %login%`n, %FTPCommandFile% ; FileAppend, %pass%`n, %FTPCommandFile% GoSub, Go ; return } go: ; { ; FileAppend, binary`n, %FTPCommandFile% ; prev= ToolTip ... Loop ; { ; ; ; ; , ; curr:=%A_Index% if not prev { prev=%curr% continue } if(!InStr(curr, ":\") and (curr!="")) { ; ":\"? prev=%prev%%A_Space%%curr% ; continue } FileGetAttrib, Attributes, %prev% IfInString, Attributes, D ; , ; GenFold(prev,FTPCommandFile,countf,TSize) else { ; , ; FileAppend, put "%prev%"`n, %FTPCommandFile% FileGetSize, dsize, %prev% TSize += %dsize% ; ; countf++ ; } if curr = break prev=%curr% } FileAppend, quit, %FTPCommandFile% ; SetFormat, float, 6.1 TSize:=TSize/(1024*1024) ToolTIp ftp.exe... ; ftp.exe Run %comspec% /c ftp.exe -s:"%FTPCommandFile%" >"%FTPLogFile%", ,Hide ToolTip ; ftp , ;========================================================; CustomColor = 666666 Gui, -Resize +LastFound +ToolWindow -Caption +AlwaysOnTop Gui, Color, %CustomColor% ;cFF9966 - Gui, Add, Progress, x0 y0 w132 h15 cFF9966 Background666666 vMyProgLoadi GuiControl, , MyProgLoadi, 0 Gui, Font, S7 c111111, Tahoma Gui, Add, Text, vMyMemLoadi BackGroundTrans x2 y2 w100 h15, 0/%Tsize% Gui, Show, h15 w132, MyProgLoadi ;=========================================================================== countf2:=0 TSize2:=0 maybeexit:=0 Loop ; ftp.exe, { Process, Exist, ftp.exe if(ErrorLevel = 0) { maybeexit++ if(maybeexit>10) ; 5 { MsgBox - ftp.exe `n . ExitApp } Sleep 500 continue } break } Loop ; 250 { ; Process, Exist, ftp.exe if((ErrorLevel = 0) or (countf2 >= countf)) ; { ; ftp.exe Gui, Destroy FileRead, mfile, %FTPLogFile% IfNotInString,mfile,logged in ;ftp.exe - { ;, MsgBox, 36, , .`n ? IfMsgBox, Yes Run, "%FTPLogFile%" break } SetFormat, float, 6.1 ToolTIp : %countf%`n: %TSize% ;ToolTip ; , Tooltip ; MsgBox Sleep 2000 ToolTip break } countf2:=0 TSize2:=0 FileRead, mfile, %FTPLogFile% Loop, Parse, mfile,`n ; { ; If(InStr(A_LoopField, "ftp: ")) { countf2++ dsize2:=SubStr(A_LoopField, 6, InStr(A_LoopField," ", 0, 6)-1) TSize2 += %dsize2% } } GuiControl, 1: , MyProgLoadi, % (countf2*100)/countf ; SetFormat, float, 6.1 TSize2:=TSize2/(1024*1024) GuiControl,Text , MyMemLoadi, %TSize2%/%TSize% Sleep 250 } ExitApp return } GenFold(path,FTPCommandFile,ByRef countf,ByRef TSize) { ; fold:=SubStr(path,InStr(path,"\",0,0)+1) ; ; ; ; - ( ) FileAppend, mkdir "%fold%"`n, %FTPCommandFile% FileAppend, cd "%fold%"`n, %FTPCommandFile% Loop, %path%\*, 1, 0 { FileGetAttrib, Attributes, %A_LOOPFILEFULLPATH% IfInString, Attributes, D ;, GenFold(A_LOOPFILEFULLPATH,FTPCommandFile,countf,TSize) else { FileAppend, put "%A_LOOPFILEFULLPATH%"`n, %FTPCommandFile% TSize += %A_LoopFileSize% countf++ } } FileAppend, cd ..`n, %FTPCommandFile% return }
; - . \ #NoTrayIcon #NoEnv SendMode Input SetWorkingDir %A_ScriptDir% curr=%1% ; , if curr= ExitApp FTPCommandFile = %A_ScriptDir%\FTPCommands.txt ; FTPLogFile = %A_ScriptDir%\FTPLog.txt ; countf:=0 TSize:=0 FileDelete %FTPCommandFile% ; FileDelete %FTPLogFile% ; FileRead, conf, %A_ScriptDir%\config.ini ; conf n:=0 Loop, parse, conf,`n ; conf { i:=0 Loop, Parse, A_LoopField, | ; | { ; con%n%%i% = %A_LoopField% ; i++ } name:=con%n%0 ; . Menu, PopUp, Add, %name%, Who ;Who - n++ ; } i:=0 n:=0 Menu, PopUp, Show ; . ; ; , ; return Who: { item:=A_THISMENUITEMPOS-1 addr:=con%item%1 login:=con%item%2 pass:=con%item%3 FileAppend, open %addr%`n, %FTPCommandFile% ; ; FileAppend, %login%`n, %FTPCommandFile% ; FileAppend, %pass%`n, %FTPCommandFile% GoSub, Go ; return } go: ; { ; FileAppend, binary`n, %FTPCommandFile% ; prev= ToolTip ... Loop ; { ; ; ; ; , ; curr:=%A_Index% if not prev { prev=%curr% continue } if(!InStr(curr, ":\") and (curr!="")) { ; ":\"? prev=%prev%%A_Space%%curr% ; continue } FileGetAttrib, Attributes, %prev% IfInString, Attributes, D ; , ; GenFold(prev,FTPCommandFile,countf,TSize) else { ; , ; FileAppend, put "%prev%"`n, %FTPCommandFile% FileGetSize, dsize, %prev% TSize += %dsize% ; ; countf++ ; } if curr = break prev=%curr% } FileAppend, quit, %FTPCommandFile% ; SetFormat, float, 6.1 TSize:=TSize/(1024*1024) ToolTIp ftp.exe... ; ftp.exe Run %comspec% /c ftp.exe -s:"%FTPCommandFile%" >"%FTPLogFile%", ,Hide ToolTip ; ftp , ;========================================================; CustomColor = 666666 Gui, -Resize +LastFound +ToolWindow -Caption +AlwaysOnTop Gui, Color, %CustomColor% ;cFF9966 - Gui, Add, Progress, x0 y0 w132 h15 cFF9966 Background666666 vMyProgLoadi GuiControl, , MyProgLoadi, 0 Gui, Font, S7 c111111, Tahoma Gui, Add, Text, vMyMemLoadi BackGroundTrans x2 y2 w100 h15, 0/%Tsize% Gui, Show, h15 w132, MyProgLoadi ;=========================================================================== countf2:=0 TSize2:=0 maybeexit:=0 Loop ; ftp.exe, { Process, Exist, ftp.exe if(ErrorLevel = 0) { maybeexit++ if(maybeexit>10) ; 5 { MsgBox - ftp.exe `n . ExitApp } Sleep 500 continue } break } Loop ; 250 { ; Process, Exist, ftp.exe if((ErrorLevel = 0) or (countf2 >= countf)) ; { ; ftp.exe Gui, Destroy FileRead, mfile, %FTPLogFile% IfNotInString,mfile,logged in ;ftp.exe - { ;, MsgBox, 36, , .`n ? IfMsgBox, Yes Run, "%FTPLogFile%" break } SetFormat, float, 6.1 ToolTIp : %countf%`n: %TSize% ;ToolTip ; , Tooltip ; MsgBox Sleep 2000 ToolTip break } countf2:=0 TSize2:=0 FileRead, mfile, %FTPLogFile% Loop, Parse, mfile,`n ; { ; If(InStr(A_LoopField, "ftp: ")) { countf2++ dsize2:=SubStr(A_LoopField, 6, InStr(A_LoopField," ", 0, 6)-1) TSize2 += %dsize2% } } GuiControl, 1: , MyProgLoadi, % (countf2*100)/countf ; SetFormat, float, 6.1 TSize2:=TSize2/(1024*1024) GuiControl,Text , MyMemLoadi, %TSize2%/%TSize% Sleep 250 } ExitApp return } GenFold(path,FTPCommandFile,ByRef countf,ByRef TSize) { ; fold:=SubStr(path,InStr(path,"\",0,0)+1) ; ; ; ; - ( ) FileAppend, mkdir "%fold%"`n, %FTPCommandFile% FileAppend, cd "%fold%"`n, %FTPCommandFile% Loop, %path%\*, 1, 0 { FileGetAttrib, Attributes, %A_LOOPFILEFULLPATH% IfInString, Attributes, D ;, GenFold(A_LOOPFILEFULLPATH,FTPCommandFile,countf,TSize) else { FileAppend, put "%A_LOOPFILEFULLPATH%"`n, %FTPCommandFile% TSize += %A_LoopFileSize% countf++ } } FileAppend, cd ..`n, %FTPCommandFile% return }
Source: https://habr.com/ru/post/57139/
All Articles