Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <TabConstants.au3>
- #include <WindowsConstants.au3>
- #include <GUIListBox.au3>
- #include <WindowsConstants.au3>
- #include <Winhttp.au3>
- #include <Array.au3>
- #include <Zlib.au3>
- #include <Date.au3>
- #include <File.au3>
- ;~ Global Const $HTTP_STATUS_OK = 200
- Global Const $HOST = 'http://toolregptc.esy.es'
- $Form1 = GUICreate("GUI", 403, 236, 192, 124)
- $Tab1 = GUICtrlCreateTab(8, 8, 385, 217)
- GUICtrlCreateTabItem("Đăng nhập")
- GUICtrlSetState(-1,$GUI_SHOW)
- GUICtrlCreateLabel("Tài khoản:", 64, 72, 55, 17)
- GUICtrlCreateLabel("Mật khẩu:", 64, 104, 52, 17)
- $login_acc = GUICtrlCreateInput("", 120, 72, 185, 21)
- $login_pass = GUICtrlCreateInput("", 128, 104, 185, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
- $Button_login = GUICtrlCreateButton("Đăng nhập", 144, 144, 75, 25)
- GUICtrlCreateTabItem("Đăng ký")
- GUICtrlCreateLabel("Tài khoản:", 72, 80, 55, 17)
- GUICtrlCreateLabel("Mật khẩu:", 72, 104, 52, 17)
- GUICtrlCreateLabel("Tên của bạn:", 72, 128, 68, 17)
- $reg_acc = GUICtrlCreateInput("", 152, 80, 169, 21)
- $reg_pass = GUICtrlCreateInput("", 152, 104, 169, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
- $reg_name = GUICtrlCreateInput("", 152, 128, 169, 21)
- $Button_reg = GUICtrlCreateButton("Đăng ký", 160, 168, 75, 25)
- GUICtrlCreateTabItem("")
- GUISetState(@SW_SHOW)
- #Region Bien
- Local $stt = 1
- Local $sttAccount = 0
- Global $iCheckbox1 = 0
- Global $iCheckUser = 0
- #EndRegion
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $Button_login
- if GUICtrlRead($login_acc) <> '' and GUICtrlRead($login_pass) <> '' Then
- Local $post = HttpPost($HOST&'/login.php','user='& GUICtrlRead($login_acc) &'&pass='&GUICtrlRead($login_pass))
- if $post == 'WRONG' Then
- MsgBox(16,'Error','Sai pass hoặc tk')
- Elseif $post == 'CANTCONNECT' Then
- MsgBox(16,'Error','Không thể kết nỗi với dữ liệu')
- Else
- $tach = StringSplit($post,'-')
- if $tach[1] == 'OK' Then
- $soAcc = BinaryToString($tach[2],4)
- $thongBao = BinaryToString($tach[3],4)
- $thongBaoTuAdmin = BinaryToString($tach[4],4)
- If $thongBao = "Run" Then
- GUIDelete()
- _Form2()
- ;~ GUISetState($Form1 , @SW_HIDE)
- Else
- MsgBox(0 , "Thông Báo" , "Bạn Không được sử dụng Phần mềm" )
- Exit
- EndIf
- Else
- MsgBox(16,'Error',$post)
- EndIf
- EndIf
- Else
- MsgBox(16,'Error','Vui lòng nhập đủ thông tin trên')
- GUICtrlSetData($login_acc , "" )
- GUICtrlSetData($login_pass , "" )
- EndIf
- Case $Button_reg
- if GUICtrlRead($reg_acc) <> '' and GUICtrlRead($reg_pass) <> '' and GUICtrlRead($reg_name) <> '' Then
- Local $post = HttpPost($HOST&'/reg.php','user='&GUICtrlRead($reg_acc)&'&pass='&GUICtrlRead($reg_pass)&'&name='&StringToBinary(GUICtrlRead($reg_name),4))
- if $post == 'DONE' Then
- MsgBox(64,'Thành công','Thành công')
- Elseif $post == 'EXIST' Then
- MsgBox(48,'Lỗi','Tài khoản đã tồn tại')
- Else
- MsgBox(16,'Error',$post)
- EndIf
- Else
- MsgBox(16,'Error','Vui lòng nhập đủ thông tin trên')
- EndIf
- Case $GUI_EVENT_CLOSE
- Exit
- EndSwitch
- WEnd
- Func HttpPost($sURL, $sData = "")
- Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
- $oHTTP.Open("POST", $sURL, False)
- If (@error) Then Return SetError(1, 0, 0)
- $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
- $oHTTP.Send($sData)
- If (@error) Then Return SetError(2, 0, 0)
- If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0)
- Return SetError(0, 0, $oHTTP.ResponseText)
- EndFunc
- Func _Form2()
- ;;Giao Diện chính của phần mềm
- EndFunc
- và các func khác nằm dưới này
Advertisement
Add Comment
Please, Sign In to add comment