Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;dang11001 - 14256789
- Global $reglink="HKEY_CURRENT_USER\Software\AutoIT login test"
- If Login() Then
- MsgBox(0,"","Đăng nhập thành công")
- ;~ nextstep()
- Else
- MsgBox(0,"", "Đã xảy ra lỗi!")
- EndIf
- Func Login()
- GUICreate("Đăng nhập",300,100)
- GUICtrlCreateLabel("Tài khoản:",10,10)
- $input_user = GUICtrlCreateInput("",70,9,220,17)
- GUICtrlCreateLabel("Mật khẩu:",10,30)
- $input_pass = GUICtrlCreateInput("",70,29,220,17, 0x0020) ; $ES_PASSWORD = 0x0020
- $login = GUICtrlCreateButton("Đăng nhập",10,50,280,40)
- GUICtrlSetData($input_user, RegRead($reglink, "username"))
- GUICtrlSetData($input_pass, RegRead($reglink, "password"))
- GUISetState()
- while 1
- Switch GUIGetMsg()
- case -3
- Exit
- Case $login
- $user_read = GUICtrlRead($input_user)
- $pass_read = GUICtrlRead($input_pass)
- If ConnectSever($user_read, $pass_read) == "OK" Then
- RegWrite($reglink, "username", "REG_SZ", $user_read)
- RegWrite($reglink, "password", "REG_SZ", $pass_read)
- Return True
- Else
- MsgBox(0,"","Đăng nhập thất bại")
- EndIf
- EndSwitch
- WEnd
- Return SetError(1, 1, False)
- EndFunc
- func ConnectSever($user, $pass)
- ;Có server
- Local $host, $target, $hOpen, $hConnect, $hRequest, $return
- $return = BinaryToString(InetRead("http://thedemons.pe.hu/login/login.php?user="&$user&"&pass="&$pass,1))
- Return ($return = "ok") ? "OK" : "FAIL"
- ;Không server
- ;~ Local $tk = "dang11001", $mk = "14256789"
- ;~ Return ($user = $tk And $pass = $mk) ? "OK" : "FAIL"
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement