He Leute, ich habe ein Problem, und zwar will ich erreichen, dass das Programm ein Backup von einer bestimmten Datei erstellt, wenn die Datei nicht vorhanden ist eine Meldung ausgibt und ansonsten die Datei von einem FTP Server herunterlädt.
Das Problem ist, dass das Programm mir immer meldet, dass es die Datei nicht kopieren kann, selbst wenn sie da ist.
Spoiler anzeigen
$copyerror = ''
GUICtrlSetData($Progress1, 90)
$l_FTPSession = _FTP_Connect($l_InternetSession, $s_ServerName, $s_Usersname, $s_Password, $i_Passive)
$file = 'craftbukkit.jar'
$ziel = $folder & '\craftbukkit.jar'
$InputSplitted = StringSplit($file, '.')
$Endung = $InputSplitted[$InputSplitted[0]]
$Name = StringTrimRight($file, StringLen($InputSplitted[$InputSplitted[0]]) + 1)
$zielcopy = $folder & '\' & $Name & '_backup' & '.' & $Endung
$copyerror = FileCopy($ziel, $zielcopy)
If $copyerror = 0 Then
If Not IsDeclared('copy') Then Local $copy
$copy = MsgBox(36, 'Fehler', 'CODE: 68 Kopieren von Datei ' & $file & ' fehlgeschlagen (gelöscht?)' & @CRLF & 'Trotzdem fortfahren?')
Select
Case $copy = 7
Exit
EndSelect
EndIf
_FTP_FileGet($l_FTPSession, $file, $ziel)
If @error Then
MsgBox(48, 'FEHLER', 'CODE:69 Download von ' & $file & ' fehlgeschlagen')
Exit
EndIf
$copyerror = ''
GUICtrlSetData($Progress1, 91)
$file = 'banned-ips.txt'
$ziel = $folder & '\banned-ips.txt'
$InputSplitted = StringSplit($file, '.')
$Endung = $InputSplitted[$InputSplitted[0]]
$Name = StringTrimRight($file, StringLen($InputSplitted[$InputSplitted[0]]) + 1)
$zielcopy = $folder & '\' & $Name & '_backup' & '.' & $Endung
$copyerror = FileCopy($ziel, $zielcopy)
If $copyerror = 0 Then
If Not IsDeclared('copy') Then Local $copy
$copy = MsgBox(36, 'Fehler', 'CODE: 68 Kopieren von Datei ' & $file & ' fehlgeschlagen (gelöscht?)' & @CRLF & 'Trotzdem fortfahren?')
Select
Case $copy = 7
Exit
EndSelect
EndIf
_FTP_FileGet($l_FTPSession, $file, $ziel)
If @error Then
MsgBox(48, 'FEHLER', 'CODE:69 Download von ' & $file & ' fehlgeschlagen')
Exit
EndIf
$copyerror = ''
GUICtrlSetData($Progress1, 92)
$file = 'banned-players.txt'
$ziel = $folder & '\banned.ips.txt'
$InputSplitted = StringSplit($file, '.')
$Endung = $InputSplitted[$InputSplitted[0]]
$Name = StringTrimRight($file, StringLen($InputSplitted[$InputSplitted[0]]) + 1)
$zielcopy = $folder & '\' & $Name & '_backup' & '.' & $Endung
$copyerror = FileCopy($ziel, $zielcopy)
If $copyerror = 0 Then
If Not IsDeclared('copy') Then Local $copy
$copy = MsgBox(36, 'Fehler', 'CODE: 68 Kopieren von Datei ' & $file & ' fehlgeschlagen (gelöscht?)' & @CRLF & 'Trotzdem fortfahren?')
Select
Case $copy = 7
Exit
EndSelect
EndIf
_FTP_FileGet($l_FTPSession, $file, $ziel)
If @error Then
MsgBox(48, 'FEHLER', 'CODE:69 Download von ' & $file & ' fehlgeschlagen')
Exit
EndIf
$copyerror = ''
GUICtrlSetData($Progress1, 93)
$file = 'bukkit.yml'
$ziel = $folder & '\bukkit.yml'
$InputSplitted = StringSplit($file, '.')
$Endung = $InputSplitted[$InputSplitted[0]]
$Name = StringTrimRight($file, StringLen($InputSplitted[$InputSplitted[0]]) + 1)
$zielcopy = $folder & '\' & $Name & '_backup' & '.' & $Endung
$copyerror = FileCopy($ziel, $zielcopy)
If $copyerror = 0 Then
If Not IsDeclared('copy') Then Local $copy
$copy = MsgBox(36, 'Fehler', 'CODE: 68 Kopieren von Datei ' & $file & ' fehlgeschlagen (gelöscht?)' & @CRLF & 'Trotzdem fortfahren?')
Select
Case $copy = 7
Exit
EndSelect
EndIf
_FTP_FileGet($l_FTPSession, $file, $ziel)
If @error Then
MsgBox(48, 'FEHLER', 'CODE:69 Download von ' & $file & ' fehlgeschlagen')
Exit
EndIf
$copyerror = ''
GUICtrlSetData($Progress1, 94)
$file = 'help.yml'
$ziel = $folder & 'help.yml'
$InputSplitted = StringSplit($file, '.')
$Endung = $InputSplitted[$InputSplitted[0]]
$Name = StringTrimRight($file, StringLen($InputSplitted[$InputSplitted[0]]) + 1)
$zielcopy = $folder & '\' & $Name & '_backup' & '.' & $Endung
$copyerror = FileCopy($ziel, $zielcopy)
If $copyerror = 0 Then
If Not IsDeclared('copy') Then Local $copy
$copy = MsgBox(36, 'Fehler', 'CODE: 68 Kopieren von Datei ' & $file & ' fehlgeschlagen (gelöscht?)' & @CRLF & 'Trotzdem fortfahren?')
Select
Case $copy = 7
Exit
EndSelect
EndIf
_FTP_FileGet($l_FTPSession, $file, $ziel)
If @error Then
MsgBox(48, 'FEHLER', 'CODE:69 Download von ' & $file & ' fehlgeschlagen')
Exit
EndIf
$copyerror = ''
GUICtrlSetData($Progress1, 95)
$file = 'ops.txt'
$ziel = $folder & 'ops.txt'
$InputSplitted = StringSplit($file, '.')
$Endung = $InputSplitted[$InputSplitted[0]]
$Name = StringTrimRight($file, StringLen($InputSplitted[$InputSplitted[0]]) + 1)
$zielcopy = $folder & '\' & $Name & '_backup' & '.' & $Endung
$copyerror = FileCopy($ziel, $zielcopy)
If $copyerror = 0 Then
If Not IsDeclared('copy') Then Local $copy
$copy = MsgBox(36, 'Fehler', 'CODE: 68 Kopieren von Datei ' & $file & ' fehlgeschlagen (gelöscht?)' & @CRLF & 'Trotzdem fortfahren?')
Select
Case $copy = 7
Exit
EndSelect
EndIf
_FTP_FileGet($l_FTPSession, $file, $ziel)
If @error Then
MsgBox(48, 'FEHLER', 'CODE:69 Download von ' & $file & ' fehlgeschlagen')
Exit
EndIf
$copyerror = ''
GUICtrlSetData($Progress1, 96)
$file = 'permissions.yml'
$ziel = $folder & 'permissions.yml'
$InputSplitted = StringSplit($file, '.')
$Endung = $InputSplitted[$InputSplitted[0]]
$Name = StringTrimRight($file, StringLen($InputSplitted[$InputSplitted[0]]) + 1)
$zielcopy = $folder & '\' & $Name & '_backup' & '.' & $Endung
$copyerror = FileCopy($ziel, $zielcopy,1)
If $copyerror = 0 Then
If Not IsDeclared('copy') Then Local $copy
$copy = MsgBox(36, 'Fehler', 'CODE: 68 Kopieren von Datei ' & $file & ' fehlgeschlagen (gelöscht?)' & @CRLF & 'Trotzdem fortfahren?')
Select
Case $copy = 7
Exit
EndSelect
EndIf
_FTP_FileGet($l_FTPSession, $file, $ziel,1)
If @error Then
MsgBox(48, 'FEHLER', 'CODE:69 Download von ' & $file & ' fehlgeschlagen')
Exit
EndIf
$copyerror = ''
$file = 'server.log'
$ziel = $folder & 'server.log'
$InputSplitted = StringSplit($file, '.')
$Endung = $InputSplitted[$InputSplitted[0]]
$Name = StringTrimRight($file, StringLen($InputSplitted[$InputSplitted[0]]) + 1)
$zielcopy = $folder & '\' & $Name & '_backup' & '.' & $Endung
$copyerror = FileCopy($ziel, $zielcopy,1)
If $copyerror = 0 Then
If Not IsDeclared('copy') Then Local $copy
$copy = MsgBox(36, 'Fehler', 'CODE: 68 Kopieren von Datei ' & $file & ' fehlgeschlagen (gelöscht?)' & @CRLF & 'Trotzdem fortfahren?')
Select
Case $copy = 7
Exit
EndSelect
EndIf
_FTP_FileGet($l_FTPSession, $file, $ziel)
If @error Then
MsgBox(48, 'FEHLER', 'CODE:69 Download von ' & $file & ' fehlgeschlagen')
Exit
EndIf
$copyerror = ''
GUICtrlSetData($Progress1, 97)
$file = 'server.properties'
$ziel = $folder & 'server.properties'
$InputSplitted = StringSplit($file, '.')
$Endung = $InputSplitted[$InputSplitted[0]]
$Name = StringTrimRight($file, StringLen($InputSplitted[$InputSplitted[0]]) + 1)
$zielcopy = $folder & '\' & $Name & '_backup' & '.' & $Endung
$copyerror = FileCopy($ziel, $zielcopy,1)
If $copyerror = 0 Then
If Not IsDeclared('copy') Then Local $copy
$copy = MsgBox(36, 'Fehler', 'CODE: 68 Kopieren von Datei ' & $file & ' fehlgeschlagen (gelöscht?)' & @CRLF & 'Trotzdem fortfahren?')
Select
Case $copy = 7
Exit
EndSelect
EndIf
_FTP_FileGet($l_FTPSession, $file, $ziel)
If @error Then
MsgBox(48, 'FEHLER', 'CODE:69 Download von ' & $file & ' fehlgeschlagen')
Exit
EndIf
$copyerror = ''
GUICtrlSetData($Progress1, 98)
$file = 'white-list.txt'
$ziel = $folder & 'white-list.txt'
$InputSplitted = StringSplit($file, '.')
$Endung = $InputSplitted[$InputSplitted[0]]
$Name = StringTrimRight($file, StringLen($InputSplitted[$InputSplitted[0]]) + 1)
$zielcopy = $folder & '\' & $Name & '_backup' & '.' & $Endung
$copyerror = FileCopy($ziel, $zielcopy,1)
If $copyerror = 0 Then
If Not IsDeclared('copy') Then Local $copy
$copy = MsgBox(36, 'Fehler', 'CODE: 68 Kopieren von Datei ' & $file & ' fehlgeschlagen (gelöscht?)' & @CRLF & 'Trotzdem fortfahren?')
Select
Case $copy = 7
Exit
EndSelect
EndIf
_FTP_FileGet($l_FTPSession, $file, $ziel)
If @error Then
MsgBox(48, 'FEHLER', 'CODE:69 Download von ' & $file & ' fehlgeschlagen')
Exit
EndIf
$copyerror = ''
GUICtrlSetData($Progress1, 99)
MsgBox(0, 'TEST', 'Finnisch mit Anderes')