Code : Tout sélectionner
...
case $dl2
Global $Url = $lien1
InetGet( $Url , @DesktopDir&'/'&$nom1, 1, 1)
$FileSize = InetGetSize ( $lien1 )
$Label13 = GUICtrlCreateLabel(Int ( ( @InetGetBytesRead * 100 ) / $FileSize ), 183, 48, 30, 27)
GUICtrlSetFont(-1, 15, 400, 0, "arialblack")
GUICtrlSetColor(-1, 0x0000FF)
$Label1 = GUICtrlCreateLabel("Nom du fichier ", 128, 90, 75, 17)
GUICtrlSetColor(-1, 0x0000FF)
$Label2 = GUICtrlCreateLabel("Taille", 342, 90, 29, 17)
GUICtrlSetColor(-1, 0x0000FF)
$Label15 = GUICtrlCreateLabel("%", 213, 48, 23, 28)
GUICtrlSetFont(-1, 16, 400, 0, "arialblack")
GUICtrlSetColor(-1, 0x0000FF)
$annuler = GUICtrlCreateLabel("Appuyez sur F12 pour annuler", 568, 13, 145, 17) ; annuler
GUICtrlSetColor(-1, 0xFF0000)
$Label12 = GUICtrlCreateLabel("Progression du téléchargement : ", 24, 53, 159, 17)
GUICtrlSetColor(-1, 0x0000FF)
$Label3 = GUICtrlCreateLabel("Lien externe (allociné, infos...)", 424, 90, 144, 17)
GUICtrlSetColor(-1, 0x0000FF)
$Label4 = GUICtrlCreateLabel("Télécharger ", 620, 90, 64, 17)
GUICtrlSetColor(-1, 0x0000FF)
$dl1 = GUICtrlCreatePic("C:\Documents and Settings\host\Bureau\telecharger.jpg", 600, 120, 100, 26)
GUICtrlSetCursor (-1, 0)
$Pic9 = GUICtrlCreatePic("C:\Documents and Settings\host\Bureau\frame_top.jpg", 4, 151, 708, 3)
$nom_gui1 = GUICtrlCreateLabel($nom1, 16, 126, 291, 18)
GUICtrlSetFont(-1, 8, 400, 0, "arial")
GUICtrlSetColor(-1, 0x0000FF)
$taille_gui1 = GUICtrlCreateLabel($taille1, 333, 126, 51, 18)
GUICtrlSetFont(-1, 8, 400, 0, "arial")
GUICtrlSetColor(-1, 0x0000FF)
$lien_gui1 = GUICtrlCreateLabel($info1, 408, 126, 175, 18)
GUICtrlSetFont(-1, 8, 400, 4, "arial")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetState(-1, $GUI_DISABLE)
$Label8 = GUICtrlCreateLabel("Bienvenue sur le client du ftp à JuMbY", 208, 8, 358, 23)
GUICtrlSetFont(-1, 12, 800, 0, "arialblack")
GUICtrlSetColor(-1, 0x0000FF)
$Pic10 = GUICtrlCreatePic("C:\Documents and Settings\host\Bureau\frame_top.jpg", 4, 190, 708, 3)
$nom_gui2 = GUICtrlCreateLabel($nom2, 16, 165, 291, 18)
GUICtrlSetFont(-1, 8, 400, 0, "arial")
GUICtrlSetColor(-1, 0x0000FF)
$taille_gui2 = GUICtrlCreateLabel($taille2, 333, 165, 51, 18)
GUICtrlSetFont(-1, 8, 400, 0, "arial")
GUICtrlSetColor(-1, 0x0000FF)
$lien_gui2 = GUICtrlCreateLabel($info2, 408, 165, 175, 18)
GUICtrlSetFont(-1, 8, 400, 4, "arial")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetState(-1, $GUI_DISABLE)
$dl2 = GUICtrlCreatePic("C:\Documents and Settings\host\Bureau\telecharger.jpg", 600, 159, 100, 26)
GUICtrlSetCursor (-1, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
$Progress1 = GUICtrlCreateProgress(240, 48, 468, 25)
$vitesse_de_telechargement = GUICtrlCreateLabel("Vitesse de téléchargement :", 24, 28, 135, 17) ; vitesse
GUICtrlSetColor(-1, 0x0000FF)
$kos = GUICtrlCreateLabel("ko/s", 192, 28, 26, 17)
GUICtrlSetColor(-1, 0x0000FF)
While @InetGetActive
GUICtrlSetData ( $progress1 , Int ( ( @InetGetBytesRead * 100 ) / $FileSize ) )
Sleep(800)
$4 = @InetGetBytesRead
sleep(1000)
$5 = @InetGetBytesRead
$vitesse_real = GUICtrlCreateLabel(Int( ( $5 / $4 ) * 100), 160, 28, 28, 17)
GUICtrlSetColor(-1, 0x0000FF)
$Label13 = GUICtrlCreateLabel(Int ( ( @InetGetBytesRead * 100 ) / $FileSize ), 183, 48, 30, 27) ; progression
GUICtrlSetFont(-1, 15, 400, 0, "arialblack")
GUICtrlSetColor(-1, 0x0000FF)
WEnd
If (Int ((@InetGetBytesRead * 100 ) / $FileSize) = 100) Then
GUICtrlDelete($Progress1)
GUICtrlDelete($Label12)
Guictrldelete($Label15)
guictrldelete($Label13)
$Label13 = GUICtrlCreateLabel("", 183, 48, 30, 27)
MsgBox(4000,"Téléchargement réussi", $download_complete1)
EndIf
ShellExecute(@ScriptFullPath)
ExitLoop