|
You last visited: Today at 10:10
Advertisement
2 Fragen
Discussion on 2 Fragen within the AutoIt forum part of the Coders Den category.
02/22/2011, 22:26
|
#16
|
elite*gold: 52
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
|
Probiers so vllt nochmal
PHP Code:
#include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <INet.au3> Global $iSize Global $geladen = 0 $iSize = InetGetSize("http://***") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Updater", 377, 65, 192, 124) $Progress1 = GUICtrlCreateProgress(8, 32, 353, 25) $Label2 = GUICtrlCreateLabel($geladen & " KB von " & $iSize & " KB geladen", 8, 8, 355, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $inetget = InetGet("http://***", @ScriptDir & "\***.exe", 1) While 1 $lSize = FileGetSize(@ScriptDir & "***.exe") $prozent = Round(InetGetInfo($inetget) / $iSize * 100) GUICtrlSetData($Progress1, $prozent) GUICtrlSetData($Label2, Round($geladen) & " KB von " & Round($iSize) & " KB geladen") If $lSize = $iSize Then GUICtrlSetData($Progress1, 100) GUICtrlSetData($Label2, Round($lSize) & " KB von " & Round($iSize) & " KB geladen") ExitLoop EndIf WEnd While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
|
|
|
02/22/2011, 22:31
|
#17
|
elite*gold: 17
Join Date: Jul 2009
Posts: 1,562
Received Thanks: 478
|
Du hast nur das Round und das /1000 weg oder?
Weil so hatte ich das vorher auch und es hat nicht geklappt^^
So geht es sogar noch schlechter als vorher (er hängt sich auf:P)
|
|
|
02/23/2011, 15:33
|
#18
|
elite*gold: 52
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
|
So hab jetzt nochmal in ruhe gemacht
PHP Code:
#include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <INet.au3> $INetGroese = InetGetSize("http://") $geladen = 0 $Form1 = GUICreate("Updater", 377, 65, 192, 124) $Progress1 = GUICtrlCreateProgress(8, 32, 353, 25) $Label2 = GUICtrlCreateLabel($geladen & " KB von " & $INetGroese & " KB geladen", 8, 8, 355, 17) GUISetState(@SW_SHOW)
$CompGroese = FileGetSize("*.*") If $INetGroese <> $CompGroese Then
$InetGet = InetGet("http://", @scriptdir&"\*.*", 1, 1) While 1 $Groese = FileGetSize(@scriptdir&"\*.*") $Prozent = Round(InetGetInfo($InetGet) / $INetGroese * 100) GUICtrlSetData($Progress1, $Prozent) GUICtrlSetData($Label2, $geladen & " KB von " & $INetGroese & " KB geladen") If $Groese = $INetGroese Then GUICtrlSetData($Label2, $Groese & " KB von " & $INetGroese & " KB geladen") GUICtrlSetData($Progress1, 100) ExitLoop EndIf WEnd EndIf
While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit
EndSwitch WEnd
|
|
|
02/23/2011, 16:12
|
#19
|
elite*gold: 0
Join Date: Feb 2010
Posts: 344
Received Thanks: 151
|
Wenn du die Datei über das ausgeführte Programm speichern lässt, dann kannst du es damit davor schützen :
PHP Code:
$split = StringSplit(@AutoItExe,"\") If $split[UBound($split) - 1] = "exe.exe" Then InetGet("http://url.de/exe.exe","Dateiname.exe") ElseIf $split[UBound($split) - 1] = "Dateiname.exe" Then InetGet("http://url.de/exe.exe","exe.exe") Else InetGet("http://url.de/exe.exe","exe.exe") EndIf
|
|
|
02/23/2011, 18:45
|
#20
|
elite*gold: 17
Join Date: Jul 2009
Posts: 1,562
Received Thanks: 478
|
Ich glaub ich weiß mittlerweile, was der Fehler ist. Die Lösung aber noch nicht^^:
Es wird erst das InetGet aus, und geht dann im Code weiter. Desshalb wird das Label und die ProgressBar erst wenn der Download abgeschlossen ist aktualisiert.
Kann man das so machen, dass schon während dem Download aktualisiert wird?
|
|
|
02/23/2011, 18:59
|
#21
|
elite*gold: 0
Join Date: Feb 2010
Posts: 344
Received Thanks: 151
|
Hast du auch wie BlackHybrid bei InetGet den 4. Parameter auf 1 gesetzt? Sonst wird der Skript pausiert, bis das Download fertig ist.
|
|
|
02/23/2011, 19:04
|
#22
|
elite*gold: 17
Join Date: Jul 2009
Posts: 1,562
Received Thanks: 478
|
Ahhh ok^^
Laut AutoIt Hilfe sollte er weiter machen, MACHT ER ABER NICHT-.-^^
|
|
|
02/23/2011, 19:07
|
#23
|
elite*gold: 0
Join Date: Feb 2010
Posts: 344
Received Thanks: 151
|
Probier einfach mal, dass der Downloader ein anderes Programm ist, welches mit FileInstall in das Hauptprogramm integriert wurde.
|
|
|
02/23/2011, 19:42
|
#24
|
elite*gold: 17
Join Date: Jul 2009
Posts: 1,562
Received Thanks: 478
|
Das Downloader ist bis jetzt in keinem anderen Programm.
Er ist alleine zum testen, bis er läuft.
Ich hab dann vor, das Script zu Includen und eine _CheckUpdate() und eine _GetUpdate() Funktion zu schreiben.
Aber dazu muss er erstmal laufen^^
|
|
|
02/23/2011, 20:04
|
#25
|
elite*gold: 0
Join Date: Feb 2010
Posts: 344
Received Thanks: 151
|
Ich habe es mal ausprobiert und funktioniert einwandfrei :
PHP Code:
#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("", 625, 80, 192, 124) $Label1 = GUICtrlCreateLabel("", 12, 8, 596, 52) GUISetState(@SW_SHOW) $size = InetGetSize("http://url.de/exe.exe") $inetget = InetGet("http://url.de/exe.exe","exe.exe",1,1) While 1 $nMsg = GUIGetMsg() If $nMsg = $GUI_EVENT_CLOSE Then Exit EndIf $derzeitheruntergeladen = FileGetSize("exe.exe") $infos = InetGetInfo($inetget) $derzeitheruntergeladen = $infos[0] GUICtrlSetData($Label1,$derzeitheruntergeladen&" Bytes / "&$size&" Bytes heruntergeladen. ") WEnd
|
|
|
02/23/2011, 20:18
|
#26
|
elite*gold: 17
Join Date: Jul 2009
Posts: 1,562
Received Thanks: 478
|
Danke!!!
Habs jetzt an meinen Code angepasst, und es geht.
Ich weiß zwar nicht wieso es davor nicht ging aber egal^^
Und eine Frage noch:
Was bewirkt diese Zeile:
PHP Code:
$derzeitheruntergeladen = $infos[0]
??
|
|
|
02/23/2011, 20:39
|
#27
|
elite*gold: 0
Join Date: Feb 2010
Posts: 344
Received Thanks: 151
|
Quote:
Originally Posted by poll7979
Was bewirkt diese Zeile:
PHP Code:
$derzeitheruntergeladen = $infos[0]
??
|
Da muss ich nicht überall [0] eingeben :P
|
|
|
02/23/2011, 20:58
|
#28
|
elite*gold: 17
Join Date: Jul 2009
Posts: 1,562
Received Thanks: 478
|
Ich hab es jetzt so umgeschrieben, dass ich es in meine Scripts Includen kann.
PHP Code:
#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <String.au3> Func _GetUpdate($UpdateServer, $DateiName) $Form1 = GUICreate("Updater", 377, 65, 192, 124) $Label1 = GUICtrlCreateLabel("", 8, 8, 355, 17) $Progress1 = GUICtrlCreateProgress(8, 32, 353, 25) GUISetState(@SW_SHOW) $size = InetGetSize($UpdateServer & "/" & $DateiName) $inetget = InetGet($UpdateServer & "/" & $DateiName,1,1) While 1 $nMsg = GUIGetMsg() If $nMsg = $GUI_EVENT_CLOSE Then Exit EndIf $infos = InetGetInfo($inetget) $derzeitheruntergeladen = $infos[0] $fortschritt = Round($derzeitheruntergeladen / $size * 100) GUICtrlSetData($Label1,$derzeitheruntergeladen&" Bytes / "&$size&" Bytes heruntergeladen. ") GUICtrlSetData($Progress1,$fortschritt) WEnd EndFunc
Func _CheckUpdate($vers_old, $UpdateServer) $vers_new_hex = InetRead($UpdateServer&"/vers") $vers_new = _HexToString($vers_new_hex) If $vers_new <> $vers_old Then Return True Else Return False EndIf EndFunc
_CheckUpdate funtkioniert, aber bei _GetUpdate bekomme ich folgenden Fehler:
Code:
****\update.au3 (18) : ==> Subscript used with non-Array variable.:
$derzeitheruntergeladen = $infos[0]
$derzeitheruntergeladen = $infos^ ERROR
€dit: Hat sich geklärt
|
|
|
Similar Threads
|
xBox 360 .. Fragen Fragen und nochmal Fragen !
01/05/2011 - Consoles - 12 Replies
^Tach elitepvpers....
Also ich hab ne xBox 360 (was glaube ich viele haben^^)
1.Frage : Wie findet ihr (die mit der xBox306) das neue Uptade
2.Frage : Was ist euer lieblingsspiel???
1.Antwort^^: Update sieht eig. ganz gut aus ...Trotzdem is das orginal am besten ^^
|
[Fragen]Fragen über Crossfire von Anfänger-Pro's
12/14/2010 - CrossFire - 4 Replies
In diesem Thread könnt ihr fragen stellen(auch fragen die manche dumm finden):cool:
|
All times are GMT +2. The time now is 10:10.
|
|