You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1 [AutoIt] - Computer Talks Authorization on Wed Dec 29, 2010 9:44 pm

The Professor

avatar
Contributor
Loading
You guys can thank me later.
Something I forgot to release a while ago.

Code:
; Created by Protozoid.

#Region ---Includes---
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#region ---GUI---
$Form1 = GUICreate("Computer Talks | Login", 228, 150, 192, 124, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS))
$Input1 = GUICtrlCreateInput("Username", 24, 16, 177, 21)
$Input2 = GUICtrlCreateInput("Password", 24, 56, 177, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
$Button1 = GUICtrlCreateButton("Login", 8, 96, 209, 25, $WS_GROUP)
$Label2 = GUICtrlCreateLabel("Computer Talks", 3, 136, 92, 17)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetFont(-2, 8, 400, 4, "MS Sans Serif")
GUICtrlSetCursor(-3, 0)
GUISetState()

#Region ---Functionality---
While 1
   $gMsg = GUIGetMsg()
   Switch $gMsg
      Case $GUI_EVENT_CLOSE
         Close()
      Case $Button1
         Login()
      Case $Label2
         _ShellExecute()
   EndSwitch
WEnd

Func Close()
   Exit
EndFunc  ;==>Close

Func Wrapper_P($oMethod, $oURL, $oReferrer = "", $oData = "", $oContent_Type = "application/x-www-form-urlencoded")
   Global $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

   $oHTTP.Open($oMethod, $oURL, False)

   $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 BTRS28059 Firefox/3.6.12 (.NET CLR 3.5.30729) SuperSearchSearchToolbar/1.2")

   If $oMethod == "GET" Then
      $oReferrer = ""
      $oData = ""
   EndIf

   If $oMethod == "POST" Then
      $oReferrer = $oReferrer
      $oData = $oData

      $oHTTP.SetRequestHeader("Referrer", $oReferrer)
      $oHTTP.SetRequestHeader("Content-Type", $oContent_Type)
   EndIf

   $oHTTP.Send($oData)

   $oResponse = $oHTTP.ResponseText()

   Return $oResponse
EndFunc  ;==>Wrapper_P

Func Login()
   Local $oAutoItError = ObjEvent("AutoIt.Error", "oError")

   $GET = Wrapper_P("GET", "http://www.computalks.com/login?" & "username=" & GUICtrlRead($Input1) & "&password=" & GUICtrlRead($Input2) & "&login=Log+in")

   If StringInStr($GET, "Welcome") Then
      GUICtrlSetData($Input1, "")
      GUICtrlSetData($Input2, "")
      MsgBox(0, "", "Login Successful!")
      GUIDelete($Form1)
      Client()
   Else
      GUICtrlSetData($Input1, "")
      GUICtrlSetData($Input2, "")
      MsgBox(0, "", "Login Unsucessful!")
   EndIf
EndFunc  ;==>Login

Func _ShellExecute()
   ShellExecute("http://www.computalks.com")
EndFunc  ;==>_ShellExecute

Func oError()
   SetError(1)
   MsgBox(16, "", "Error! This program has encountered a terminal error and will now close.", 4)
   Exit
EndFunc  ;==>oError

Func Client()
   ; Your main script / function starts here.
EndFunc  ;==>Client

#EndRegion ---Functionality---

2 Re: [AutoIt] - Computer Talks Authorization on Sun Jan 09, 2011 9:03 pm

OwenWilson

avatar
Master
Loading
ill thank u now Razz
thank u protzoid!!

3 Re: [AutoIt] - Computer Talks Authorization on Sun Jan 09, 2011 9:12 pm

DJ Fresh

avatar
Master
Loading
No thanks to papa haha.

4 Re: [AutoIt] - Computer Talks Authorization on Sun Jan 09, 2011 10:04 pm

OwenWilson

avatar
Master
Loading
lol idk who papa is anyway!!
lmao

Sponsored content


Loading

View previous topic View next topic Back to top  Message [Page 1 of 1]

Related topics

Permissions in this forum:
You cannot reply to topics in this forum