Hi everyone , i decided to share some little home-made creation.
This is a downloader.
It still have to do some improovements , use it as you like (I think it's quite useless).
This is a downloader.
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$doIng = "0"
#Region ### START Koda GUI section ### Form=C:\Users\Utente\Documents\loldownlaod.kxf
$Form2 = GUICreate("Downloader", 241, 64, -1, -1)
$Download = GUICtrlCreateButton("Download", 161, 6, 75, 25)
$link = GUICtrlCreateInput("", 7, 7, 150, 24)
$Dprogress = GUICtrlCreateProgress(7, 34, 150, 24)
$Dspeed = GUICtrlCreateLabel("0kb/s", 168, 39, 36, 24)
$Cp = GUICtrlCreateLabel("0", 209, 39, 22, 24)
GUICtrlCreateLabel("%", 219, 39, 36, 24)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If $doIng = "0" Then
Exit
Else
InetClose ($do)
Sleep (600)
Exit
EndIf
Case $Download
$DLINK = GUICtrlRead ($link)
If $DLINK = "" Then
MsgBox (0,"Error","A link must be inserted")
Else
_Download()
EndIf
EndSwitch
WEnd
Func _Download()
$doIng = "1"
$est = StringRight ($DLINK,3)
$nick = FileSaveDialog ("Choose a filename","","File in download (*." & $est & ")",2,"")
If $nick = "" Then
Sleep (100)
Else
$do = InetGet ($DLINK, $nick & "." & $est,1,1)
$doneornot = InetGetInfo ($do,2)
While $doneornot = False
$byteD = InetGetInfo ($do,0)
Sleep (1000)
$NbyteD = InetGetInfo ($do,0)
$bps = $NbyteD - $byteD
$kbps = $bps / 1024
If $kbps > 1024 Then
$kbps = $kbps /1024
GuiCtrlSetData ($Dspeed,$kbps & " mbs")
Else
GuiCtrlSetData ($Dspeed,$kbps & " kbs")
EndIf
$size = InetGetInfo ($do,1)
$percent = $byteD / $size * 100
GUICtrlSetData ($Dprogress,$percent)
GUICtrlSetData ($Cp,$percent)
If $percent = 100 Then
Sleep (700)
MsgBox (0,"","Download complete")
GUICtrlSetData ($Dprogress,"0")
InetClose ($do)
$doIng = "0"
GUICtrlSetData ($Cp,"0")
ExitLoop
EndIf
WEnd
EndIf
EndFunc