J'ai un problème avec un script pourtant basique de téléchargement de fichier.
Merci de m'aider.
Voila le code :
Code : Tout sélectionner
Opt("GUIOnEVentMode", 1)
$GUI = GUICreate("Installation", 325, 82, 193, 125)
$Label = GUICtrlCreateLabel("Installation en cours", 112, 8, 194, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Microsoft Tai Le")
$Icon = GUICtrlCreateIcon("shell32.dll", 153, 0, 0, 81, 81, 0)
GUISetOnEvent ($GUI_EVENT_CLOSE, "_Exit")
$Progress = GUICtrlCreateProgress(88, 40, 233, 25)
GUISetState(@SW_SHOW)
$x_handle = InetGet("http://site.com/setup.exe", @ProgramFilesDir&"\Test\)
$s_size = InetGetSize("http://site.com/setup.exe")
$x_info = InetGetInfo()
Do
$bytes_read = InetGetInfo($x_handle, 0)
$s_progress = ($bytes_read / $s_size) * 100
GUICtrlSetData($Progress, Int($s_progress))
Until InetGetInfo($x_handle, 2)
GUICtrlSetData($Label, "Terminé !")
Sleep(2000)
GUIDelete()

