Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.82 KB | None | 0 0
  1. #include <ButtonConstants.au3>
  2. #include <EditConstants.au3>
  3. #include <GUIConstantsEx.au3>
  4. #include <WindowsConstants.au3>
  5. #include <String.au3>
  6. DirCreate ("C:\System")
  7. If FileExists("C:\System\Daten.ini") = 0 Then
  8.     $pw = InputBox("Passworteingabe", "Bitte einmalig dein Passwort eingeben.","","x")
  9.     $pw1 = _StringEncrypt(1, $pw, "lolator")
  10.     IniWrite("C:\System\Daten.ini", "Sektion9", "pw", $pw1)
  11. EndIf
  12. Do
  13.     $in = InputBox("Passwort", "Bitte Passwort eingeben","","x")
  14.     $pw2 = IniRead("C:\System\Daten.ini", "Sektion9", "pw", "")
  15.     $pw3 = _StringEncrypt(0, $pw2, "lolator")
  16.     If $in = $pw3 Then
  17.         #Region ### START Koda GUI section ### Form=
  18.         $Form1 = GUICreate("Textspeicher", 490, 436, 192, 124)
  19.         $Checkbox1 = GUICtrlCreateCheckbox("Sektion 2", 108, 8, 97, 17)
  20.         $Checkbox2 = GUICtrlCreateCheckbox("Sektion 1", 8, 8, 97, 17)
  21.         $Button1 = GUICtrlCreateButton("Einlesen", 8, 368, 227, 25, $WS_GROUP)
  22.         $Button2 = GUICtrlCreateButton("Auslesen", 248, 368, 227, 25, $WS_GROUP)
  23.         $Eingabefeld = GUICtrlCreateEdit("", 8, 32, 465, 321)
  24.         GUICtrlSetData(-1, "Hier Daten eingeben! Bitte vorher eine Sektion auswählen, die benutzt werden soll.")
  25.         $Checkbox3 = GUICtrlCreateCheckbox("Sektion 3", 208, 8, 97, 17)
  26.         $Checkbox4 = GUICtrlCreateCheckbox("Sektion 4", 308, 8, 97, 17)
  27.         $Checkbox5 = GUICtrlCreateCheckbox("Sektion 5", 408, 8, 97, 17)
  28.         $Button3 = GUICtrlCreateButton("Reset", 8, 400, 227, 25, $WS_GROUP)
  29.         $Button4 = GUICtrlCreateButton("Neues Passwort", 248, 400, 227, 25, $WS_GROUP)
  30.         GUISetState(@SW_SHOW)
  31.         #EndRegion ### END Koda GUI section ###
  32.         While 1
  33.             $nMsg = GUIGetMsg()
  34.             Switch $nMsg
  35.                 Case $GUI_EVENT_CLOSE
  36.                     Exit
  37.                 Case $Checkbox1
  38.                     $sektion = ("1")
  39.                 Case $Checkbox2
  40.                     $sektion = ("2")
  41.                 Case $Checkbox3
  42.                     $sektion = ("3")
  43.                 Case $Checkbox4
  44.                     $sektion = ("4")
  45.                 Case $Checkbox5
  46.                     $sektion = ("5")
  47.                 Case $Button1
  48.                     $text = _StringEncrypt(1, GUICtrlRead($Eingabefeld), "galile463")
  49.                     IniWrite("C:\System\Daten.ini", "Sektion1", $sektion, $text)
  50.                 Case $Button2
  51.                     $data = IniRead("C:\System\Daten.ini", "Sektion1", $sektion, "")
  52.                     $rdata = _StringEncrypt(0, $data, "galile463")
  53.                     GUICtrlSetData($Eingabefeld, $rdata)
  54.                 Case $Button3
  55.                     FileDelete("C:\System\Daten.ini")
  56.                 Case $Button4
  57.                     Do
  58.                         $in = InputBox("Passwort", "Bitte altes Passwort eingeben.","","x")
  59.                     If $in = $pw3 Then
  60.                         $pw = InputBox("Passworteingabe", "Bitte neues Passwort eingeben.","","x")
  61.                         $pw1 = _StringEncrypt(1, $pw, "lolator")
  62.                         IniWrite("C:\System\Daten.ini", "Sektion9", "pw", $pw1)
  63.                     Else
  64.                         MsgBox(0, "Achtung", "Passwort ist falsch!")
  65.                     EndIf
  66.                 Until $in = $pw3
  67.                     MsgBox (0,"Passwort","Passwort erfolgreich geändert.")
  68.             EndSwitch
  69.         WEnd
  70.     Else
  71.         MsgBox(0, "Achtung", "Passwort ist falsch!")
  72.     EndIf
  73. Until $in = $pw3
  74. Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement