Advertisement
Guest User

Untitled

a guest
Oct 7th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.19 KB | None | 0 0
  1. ;~ Code source Tutoriel Kintow
  2.  
  3. #include <Crypt.au3>
  4. #include <ButtonConstants.au3>
  5. #include <EditConstants.au3>
  6. #include <GUIConstantsEx.au3>
  7. #include <WindowsConstants.au3>
  8. #Region ### START Koda GUI section ### Form=
  9. $Form1 = GUICreate("Tutoriel Kintow", 306, 84, 192, 124)
  10. $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 16, 8, 97, 17)
  11. $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 16, 32, 97, 17)
  12. $Input1 = GUICtrlCreateInput("", 16, 56, 273, 17)
  13. $Button1 = GUICtrlCreateButton("Vérifier", 112, 8, 177, 41)
  14. GUISetState(@SW_SHOW)
  15. #EndRegion ### END Koda GUI section ###
  16. GuiCtrlSetState($Checkbox1,$GUI_DISABLE)
  17. While 1
  18.     $nMsg = GUIGetMsg()
  19.     Switch $nMsg
  20.         Case $GUI_EVENT_CLOSE
  21.             Exit
  22.         Case $Button1
  23.             VerifPass()
  24.  
  25.     EndSwitch
  26. WEnd
  27.  
  28. Func VerifPass()
  29. ;~  On vérifie que l'entrée dans l'input donne le même hash au MD5
  30.     If _Crypt_HashData(GuiCtrlRead($Input1),$CALG_MD5) = "0xFC54D6A4062D075C7D4DACBEEE4C11D0" Then
  31. ;~  Dans ce cas, on y est
  32.         MsgBox(0,"GG !","Bon mot de passe")
  33. ;~  On dévérouille la CheckBox bloquée
  34.         GuiCtrlSetState($Checkbox1,$GUI_ENABLE)
  35.     Else
  36. ;~  Dans ce cas, ce n'est pas le bon
  37.         MsgBox(16,"Sorry :( !","Mauvais mot de passe")
  38.     EndIf
  39. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement