Spoiler anzeigen
#include <WindowsConstants.au3>
$uplog = FileSelectFolder("Ordner wählen... ", "")
if stringlen ($uplog) > 3 then $uplog &= "\"
if stringinstr ($uplog, ":\") = 0 then
$uplog = 0
msgbox(64,"Test","Vorgang auf Wunsch abgebrochen.")
exit
endif
$download = InetGetSize ( "http://hilfe.telekom.de/dlp/eki/downloads/Internet_Software/Software%206.0%20f.%20WinXP%20u.%20Vista/T-Online_6.0.exe", 1 )
$Form1 = GUICreate("Test", 300, 120)
$Button1 = GUICtrlCreateButton("Bitte warten...", 100, 10, 100, 25, $WS_GROUP)
$Progress1 = GUICtrlCreateProgress(20, 55, 260, 25)
$label1 = GUICtrlCreatelabel("T-Online_6.0.exe", 21, 38, 260, 15 )
$label2 = GUICtrlCreatelabel("0 KB von " & int($download/1024) & " KB", 21, 84, 260, 15 )
GUISetState(@SW_SHOW)
Opt("GuiOnEventMode", 0)
if $download > 0 then
$update = InetGet ( "http://hilfe.telekom.de/dlp/eki/downloads/Internet_Software/Software%206.0%20f.%20WinXP%20u.%20Vista/T-Online_6.0.exe", $uplog & "T-Online_6.0.exe", 1, 1)
local $sofar, $diff2
GUICtrlSetData($button1,"abbrechen")
do
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button1
InetClose($update)
msgbox(64,"Test","Vorgang auf Wunsch abgebrochen.")
GUICtrlSetData($button1,".")
EndSwitch
$sofar=InetGetInfo($update, 0)
sleep(50)
$diff2=InetGetInfo($update, 0)
GUICtrlSetData($Progress1, int(($sofar/$download)*100))
GUICtrlSetData($label2, int($sofar/1024) & " KB von " & int($download/1024) & " KB (" & round(($diff2-$sofar)/51.2, 1) & " KB/s)")
if InetGetInfo($update, 2) then GUICtrlSetData($button1,".")
until GUICtrlRead ($button1) = "."
GUIDelete($form1)
endif
hatte da auch schon mal was gebastelt. was mir an deinem code spontan auffällt ist das sleep() statt timerdiff verwendet wird.