#include <ButtonConstants.au3>
#include <GUIListBox.au3>
#include <IE.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$file = @WorkingDir & "\register.jpg"
FileDelete($file)
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("YY注册机", 441, 226, 350, 291)
$Pic1 = GUICtrlCreatePic("", 11, 112, 200, 70, BitOR($GUI_SS_DEFAULT_PIC,$WS_CLIPSIBLINGS))
;$LabelCheck = GUICtrlCreateLabel("看不清图片点击图片更换", 43, 188, 136, 17)
$listview = GUICtrlCreateListView("帐 号|密 码", 224, 16, 200, 190)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 95)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 95)
$listview_0 = GUICtrlCreateListViewItem("name|password", $listview)
$Label1 = GUICtrlCreateLabel("用户名", 16, 16, 40, 17)
$Label2 = GUICtrlCreateLabel("密 码", 16, 48, 40, 17)
$Label3 = GUICtrlCreateLabel("验证码", 16, 80, 36, 17)
$Input1 = GUICtrlCreateInput("", 64, 16, 145, 21)
$Input2 = GUICtrlCreateInput("", 64, 48, 145, 21)
$Input3 = GUICtrlCreateInput("", 64, 80, 145, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Dim $pic, $oForm, $oIE
_get_key()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Input3
If StringLen(GUICtrlRead($Input1)) < 4 Or StringLen(GUICtrlRead($Input1)) > 16 Or StringLen(GUICtrlRead($Input2)) < 6 Or StringLen(GUICtrlRead($Input2)) > 20 Then
MsgBox(4096, "", "你的输入不符合注册要求,检查一下你什么没填")
Else
Reg()
EndIf
EndSwitch
WEnd
Func Reg()
$name = GUICtrlRead($Input1)
$password = GUICtrlRead($Input2)
$yzm = GUICtrlRead($Input3)
$oIE = _IECreate("http://udb.yy.com/register.do", 0, 0, 1) ;注册网页
$oForm = _IEFormGetObjByName($oIE, "frmpost")
$oQuery = _IEFormElementGetObjByName($oForm, "username") ;用户名
_IEFormElementSetValue($oQuery, $name)
$oQuery = _IEFormElementGetObjByName($oForm, "password") ;密码
_IEFormElementSetValue($oQuery, $password)
$oQuery = _IEFormElementGetObjByName($oForm, "password2") ;再次输密码
_IEFormElementSetValue($oQuery, $password)
$oQuery = _IEFormElementGetObjByName($oForm, "securityCode") ;验证码
_IEFormElementSetValue($oQuery, $yzm)
$xieyi = _IEFormElementGetObjByName($oForm, "agreement") ;同意协议
_IEAction($xieyi, "click") ;点击协议
$button = _IEFormElementGetObjByName($oForm, "submitButton") ;按钮
$ture = _IEAction($button, "click") ;点击按钮
$sText = _IEBodyReadText($oIE)
$result = StringInStr($sText, "恭喜您注册成功")
If $result <> "0" Then
GUICtrlCreateListViewItem($name & "|" & $password, $listview)
Else
MsgBox(0, "Body Text", $sText)
EndIf
EndFunc ;==>Reg
Func _get_key()
InetGet ("http://udb.yy.com/verify/register.do", "register.jpg")
GUICtrlSetImage ($pic1,"register.jpg")
EndFunc