Hallo liebe Community,
ich habe eine Frage zu folgendem Skript:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <FTP_Ex.au3>
Global $server = "******"
Global $username = "*****"
Global $pass = "******"
Global $Open = _FTPOpen ("MyFTP Control")
Global $Conn = _FTPConnect ($Open, $server, $username, $pass)
Global $Filelist = _FTPFilesListTo2DArray ($Conn)
;Main
#Region ### START Koda GUI section ### Form=
$MainGui = GUICreate("10d - Dateiablage", 625, 443, 352, 204)
$Header = GUICtrlCreateLabel("Klasse 10d - Dateiablage", 104, 24, 418, 42)
GUICtrlSetFont(-1, 24, 800, 0, "Lucida Fax")
$ListBox = GUICtrlCreateList("", 48, 96, 337, 308)
$DownloadButton = GUICtrlCreateButton("Download", 432, 106, 145, 57, 0)
GUICtrlSetFont(-1, 14, 800, 0, "Lucida Fax")
$UploadButton = GUICtrlCreateButton("Upload", 432, 258, 145, 57, 0)
GUICtrlSetFont(-1, 14, 800, 0, "Lucida Fax")
$RefreshButton = GUICtrlCreateButton("Refresh", 432, 183, 145, 57, 0)
GUICtrlSetFont(-1, 14, 800, 0, "Lucida Fax")
$DelButton = GUICtrlCreateButton ("Löschen", 432, 335, 145, 57, 0)
GUICtrlSetFont(-1, 14, 800, 0, "Lucida Fax")
$Copyright = GUICtrlCreateLabel("Geschrieben von: ", 8, 424, 160, 17)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###
;Child
#Region ### START Koda GUI section ### Form=
$ChildGui = GUICreate("10d - Dateiablage", 483, 333, 376, 352,BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE))
$Durchsuchen = GUICtrlCreateButton("Datei auswählen...", 144, 8, 195, 49, 0)
GUICtrlSetFont(-1, 12, 800, 0, "Lucida Fax")
$UploadInput = GUICtrlCreateInput("", 48, 72, 385, 21)
$UploadButton2 = GUICtrlCreateButton("Upload!", 88, 136, 313, 57, 0)
GUICtrlSetFont(-1, 26, 800, 0, "Lucida Fax")
$Exit = GUICtrlCreateButton("Exit", 88, 224, 313, 57, 0)
GUICtrlSetFont(-1, 26, 800, 0, "Lucida Fax")
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###
For $i = 3 to UBound ($Filelist) -1
GUICtrlSetData ($ListBox, $Filelist [$i][0]&"|")
Next
GUISetState (@SW_SHOW, $MainGui)
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_FTPClose($Conn)
_FTPUnInit()
Exit
Case $DownloadButton
Global $DownFile = GUICtrlRead ($ListBox)
If $DownFile = "" Then
MsgBox (1, "Achtung!", "Erst eine Datei anklicken!")
Else
DirCreate (@ScriptDir&"\10d")
_FTP_DownloadProgress($Conn, @ScriptDir&"\10d\"&$DownFile, "/"&$DownFile)
EndIf
Case $Exit
GUISetState (@SW_HIDE, $ChildGui)
GUISetState (@SW_SHOW, $MainGui)
Case $UploadButton
GUISetState (@SW_HIDE, $MainGui)
GUISetState (@SW_SHOW, $ChildGui)
Case $Durchsuchen
Global $UploadPfad = FileOpenDialog ("Bitte die zu hochladende Datei auswählen!", "C:\", "All(*.*)")
GUICtrlSetData ($UploadInput, $UploadPfad)
Global $PfadGesplittet = StringSplit ($UploadPfad, "\")
Global $x = UBound ($PfadGesplittet) - 1
Global $DateiName = $PfadGesplittet[$x]
Case $UploadButton2
If $UploadPfad = "" Then
MsgBox (1, "Achtung!", "Erst eine Datei auswählen!")
Else
Global $UploadVorgang = _FTP_UploadProgress($Conn, $UploadPfad, "/"&$DateiName)
If $UploadVorgang = 1 Then
MsgBox (0, "Fertig!", "Die Datei wurde erfolgreich hochgeladen!")
Else
MsgBox (0, "Fehler!", "Es ist ein Fehler aufgetreten! Das Programm wird beendet!")
Exit
EndIf
EndIf
;~ Case $RefreshButton
;~ Refresh()
Case $DelButton
$DelFile = GUICtrlRead ($ListBox)
If $DelFile = "" Then
MsgBox (1, "Achtung!", "Erst die Datei anklicken!")
Else
_FTPDelFile($conn, $DelFile)
EndIf
EndSwitch
WEnd
;~ Func Refresh()
;~ ;...
;~ EndFunc
Und zwar versuche ich einen Refresh Funktion zu schreiben, die nochmal die Dateiliste abfragt, die alter dann mit der neuen ersetzt und sich selbst wiederholt. (Adlibenable)
Aber ich bekomm diese Refresh Funktion nicht.
Könnte mir jemand helfen?
PS: Frohe Weihnachten