MrTheDzam

DEMO LOGIN

Aug 31st, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.76 KB | None | 0 0
  1. #cs
  2.     VIE:
  3.     Note: Đây là bản demo đăng nhập được làm bởi MrTheDzam
  4.     Username mặc định: admin
  5.     Password mặc định: 123456
  6.  
  7.     ENG:
  8.     This is the Login demo, made by MrTheDzam (VN)
  9.     Default Username: admin
  10.     Default Password: 123456
  11. #ce
  12.  
  13.  
  14. #include <ButtonConstants.au3>
  15. #include <EditConstants.au3>
  16. #include <GUIConstantsEx.au3>
  17. #include <StaticConstants.au3>
  18. #include <WindowsConstants.au3>
  19. #Region ### START Koda GUI section ### Form=
  20.  
  21. Opt('GuiOnEventMode', -1)
  22. Global $Form1 = GUICreate("Form1", 394, 241, 192, 124)
  23. GUISetOnEvent($GUI_EVENT_CLOSE, "MainFormClose")
  24. Global $Label1 = GUICtrlCreateLabel("Username", 16, 24, 128, 36)
  25. GUICtrlSetFont(-1, 20, 400, 0, "Arial")
  26. Global $Input1 = GUICtrlCreateInput("", 184, 24, 185, 40)
  27. GUICtrlSetFont(-1, 21, 400, 0, "Arial")
  28. Global $Label2 = GUICtrlCreateLabel("Password", 16, 104, 122, 36)
  29. GUICtrlSetFont(-1, 20, 400, 0, "Arial")
  30. Global $Input2 = GUICtrlCreateInput("", 184, 96, 185, 40, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
  31. GUICtrlSetFont(-1, 21, 400, 0, "Arial")
  32. Global $Button1 = GUICtrlCreateButton("Login", 128, 168, 163, 57)
  33. GUICtrlSetOnEvent(-1, "Login")
  34. GUICtrlSetFont(-1, 20, 400, 0, "Arial")
  35. GUICtrlSetCursor (-1, 0)
  36. GUISetState(@SW_SHOW)
  37. #EndRegion ### END Koda GUI section ###
  38.  
  39. While 1
  40.     Sleep(69)
  41. WEnd
  42.  
  43. Func MainFormClose()
  44.     Exit
  45. EndFunc
  46.  
  47. Func Login()
  48.     $User = GUICtrlRead($Input1)
  49.     $Pass = GUICtrlRead($Input2)
  50.     If $User == '' or $pass == '' then
  51.         MsgBox(16, 'Message', 'Username/Password is blank')
  52.     Else
  53.         If $User == 'admin' And $pass == '123456' then
  54.             MsgBox(64, 'Message', 'Login Success!')
  55.             GUICtrlSetData($Input1, "")
  56.             GUICtrlSetData($Input2, "")
  57.         Else
  58.             MsgBox(16, 'Message', 'Login Failed: Wrong User/Password')
  59.         EndIf
  60.     EndIf
  61. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment