Hallo nochmals,
ich hahbe vor eine "update" funktion in mein Programm einzubauen, die regelmässig durch einen FTP-Server überpürft ob es etwas aktuelleres gibt. Ich habe dafür folgenden Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Dim $ver = "1.0.0"
#Region ### START Koda GUI section ### Form=c:\dokumente und einstellungen\hp_administrator\desktop\wowbot\form3.kxf
$Form3 = GUICreate("Found Update!", 384, 153, 417, 387)
GUISetBkColor(0x335EA8)
$Progress1 = GUICtrlCreateProgress(16, 128, 353, 17)
$Group1 = GUICtrlCreateGroup("New Update", 16, 8, 353, 105)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("Download", 24, 88, 337, 17, 0)
$Input1 = GUICtrlCreateInput("Input1", 24, 32, 89, 28)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetState(-1, $GUI_DISABLE)
$Input2 = GUICtrlCreateInput($ver, 24, 56, 89, 28)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetState(-1, $GUI_DISABLE)
$Label1 = GUICtrlCreateLabel("New Version", 120, 32, 80, 20)
$Label2 = GUICtrlCreateLabel("Youre Version", 120, 64, 89, 20)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label3 = GUICtrlCreateLabel("New Update", 24, 8, 79, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button1
InetGet("ftp://*******-******.bplaced.net/realeas.txt",@TempDir & "\realeas.txt", 1, 0)
$file = FileOpen(@TempDir & "\update.txt", 0)
$line = FileReadLine($file, 1)
$line2= FileReadLine($file, 2)
If $line = $ver Then
MsgBox(64, "Kein Update", "Du hast die neuste Version: (" & $ver & ")")
FileClose($file)
FileDelete(@TempDir & "\realeas.txt")
Else
MsgBox(64, "Update!", "Es ist eine Neue Version verfügbar!")
$fg = MsgBox(4, "Updaten?", "Möchtest du jetzt Updaten?")
If $fg = 6 Then
InetGet("http://*****-*****.bplaced.net/realeas.txt/" & $line2, $line2, 1, 0) ; ANPASSEN
FileClose($file)
FileDelete(@TempDir & "\realeas.txt")
Exit 0
EndIf
EndIf
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Er gibt zwar keine fehler Meldung, trotzdem baut er aber keine Verbindung auf. Nun, man muus beim Zugriff ein Benutzernamen, Password eingeben und ich weis nicht wie (ob) man ohne abfrage von Daten darauf zugreifen kann oder man irgendwie es so gin biegt das er es selbst eingibt?
mfg
EDIT: Gibt es vllt. möglichkeiten bzw Anbieter mit dennen es einfacher geht, die ihr bevorziehen würdet?