Hallo,
ich möchte mittels Autoit ganze Dateien verschlüsselt und habe dafür ein Programm geschrieben:
#include <String.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
HotKeySet("{ESC}","_Ende")
Global $pw = "123"
Global $lvl = 1
$Form1 = GUICreate("Hackrypt", 283, 128, 517, 261)
$btBrowse1 = GUICtrlCreateButton("Browse", 208, 32, 73, 25)
$tfPath1 = GUICtrlCreateInput("...", 0, 32, 209, 21)
$Radio1 = GUICtrlCreateRadio("Radio1", 19, 8, 17, 17)
$Radio2 = GUICtrlCreateRadio("Radio2", 139, 8, 17, 17)
$Label1 = GUICtrlCreateLabel("encode", 40, 8, 40, 17)
$Label2 = GUICtrlCreateLabel("decode", 160, 8, 40, 17)
$tfPath2 = GUICtrlCreateInput("...", 0, 64, 209, 21)
$btBrowse2 = GUICtrlCreateButton("Browse", 208, 64, 73, 25)
$btProgress = GUICtrlCreateButton("Progress", 48, 88, 161, 33)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $btBrowse1
$path1 = FileOpenDialog("Eingangsdatei",@WindowsDir, "(*)")
GUICtrlDelete($tfPath1)
$tfPath1 = GUICtrlCreateInput($path1, 0, 32, 209, 21)
Case $btBrowse2
$path2 = FileOpenDialog("Eingangsdatei",@WindowsDir, "(*)")
GUICtrlDelete($tfPath2)
$tfPath2 = GUICtrlCreateInput($path2, 0, 64, 209, 21)
Case $Radio1
$crypt = 1
Case $Radio2
$crypt = 0
Case $btProgress
$path1 = GUICtrlRead($tfPath1)
$path2 = GUICtrlRead($tfPath2)
_crypt(FileRead($path1),FileRead($path2),$crypt)
EndSwitch
WEnd
Func _crypt($txt,$destination,$crypt)
$crypted = _StringEncrypt($crypt,$txt,$pw,$lvl)
;edit: trotzdem keine datei
FileWrite($destination,$crypted)
MsgBox(0,"Success!","Successfully encrypted data!",1)
EndFunc
Func _Ende()
Exit
EndFunc
Es wird allerdings keine Datei erstellt.
Kann mir jemand helfen?
LG
Captain09