Ich habe zur Übung einen kleinen Script geschrieben, um Datein runterzuladen und den Download-Status anzeigen zu lassen.
Aber der Script zeigt weder in der ProgressBar den Fortschritt an, noch verändert er die Anzeige der runtergeladenen Bytes.
Und wenn die Datei runtergeladen wurde, beendet er sich auch nicht.
Wo liegt hier der Fehler?
$title = "Download"
$maintext = "Datei wird heruntergeladen"
$subtext = " Byte heruntergeladen"
$var = 100
$size_current = 0
Do
$url = InputBox ( $title, "URL eingeben" & @CRLF & "Bsp. http://www.site.com/game.exe" )
$filename = InputBox ( $title, "Lokalen Dateinamen eingeben" & @CRLF & "Bsp. game.exe" )
Until $url <> "" And $filename <> ""
$size_full = InetGetSize ( $url )
$percent = $size_full / $var
ProgressOn ( $title, $maintext, $size_current & $subtext )
$file = InetGet ( $url, $filename, "", 1 )
[/autoit][autoit][/autoit][autoit]Do
[/autoit][autoit][/autoit][autoit]Sleep ( $var )
$size_current = InetGetInfo ( $file )
$size_percent = $size_current * $percent
ProgressSet ( $size_percent, $size_current & $subtext, $maintext )
Until $size_percent = $var
[/autoit][autoit][/autoit][autoit]ProgressOff ()
[/autoit]