Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs
- VIE:
- Note: Đây là bản demo đăng nhập được làm bởi MrTheDzam
- Username mặc định: admin
- Password mặc định: 123456
- ENG:
- This is the Login demo, made by MrTheDzam (VN)
- Default Username: admin
- Default Password: 123456
- #ce
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #Region ### START Koda GUI section ### Form=
- Opt('GuiOnEventMode', -1)
- Global $Form1 = GUICreate("Form1", 394, 241, 192, 124)
- GUISetOnEvent($GUI_EVENT_CLOSE, "MainFormClose")
- Global $Label1 = GUICtrlCreateLabel("Username", 16, 24, 128, 36)
- GUICtrlSetFont(-1, 20, 400, 0, "Arial")
- Global $Input1 = GUICtrlCreateInput("", 184, 24, 185, 40)
- GUICtrlSetFont(-1, 21, 400, 0, "Arial")
- Global $Label2 = GUICtrlCreateLabel("Password", 16, 104, 122, 36)
- GUICtrlSetFont(-1, 20, 400, 0, "Arial")
- Global $Input2 = GUICtrlCreateInput("", 184, 96, 185, 40, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
- GUICtrlSetFont(-1, 21, 400, 0, "Arial")
- Global $Button1 = GUICtrlCreateButton("Login", 128, 168, 163, 57)
- GUICtrlSetOnEvent(-1, "Login")
- GUICtrlSetFont(-1, 20, 400, 0, "Arial")
- GUICtrlSetCursor (-1, 0)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- While 1
- Sleep(69)
- WEnd
- Func MainFormClose()
- Exit
- EndFunc
- Func Login()
- $User = GUICtrlRead($Input1)
- $Pass = GUICtrlRead($Input2)
- If $User == '' or $pass == '' then
- MsgBox(16, 'Message', 'Username/Password is blank')
- Else
- If $User == 'admin' And $pass == '123456' then
- MsgBox(64, 'Message', 'Login Success!')
- GUICtrlSetData($Input1, "")
- GUICtrlSetData($Input2, "")
- Else
- MsgBox(16, 'Message', 'Login Failed: Wrong User/Password')
- EndIf
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment