本帖最后由 kxing 于 2013-10-31 19:25 编辑
再请问下,为何我获取到的验证码用来回帖总提示验证码错误呢?
是否还要传入其他什么和验证码对应的参数呢?
这是我抓包的post数据:#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$file = @ScriptDir & "\00000.gif"
FileDelete($file)
$Form1 = GUICreate("Form1", 300, 200, -1, -1)
guisetbkcolor(0x000000)
$Pic1 = GUICtrlCreatePic("", 80, 30, 140, 50, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$LabelCheck = GUICtrlCreateLabel("看不清图片点击图片更换", 80, 85, 136, 17)
$hCheckcode=guictrlcreateinput("",10,170,60,20)
$hOK=guictrlcreatebutton("submit",70,170,60,20)
GUISetState(@SW_SHOW)
nRePic()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Pic1
nRePic()
case $hOK
$url="http://bbs.tianya.cn/api?method=bbs.ice.reply"
$data="params.artId=972¶ms.item=50043¶ms.appId=bbs¶ms.appBlock=50043¶ms.postId=972¶ms.preUrl=http%3A%2F%2Fbbs.tianya.cn%2Fpost-50043-972-1.shtml¶ms.preTitle=111111%E3%80%90%E9%A2%A0%E8%A6%86%E6%80%A7%E6%8E%A8%E7%90%86%E3%80%91%E9%87%91%E6%98%93%E6%81%92%E8%A7%A3%E8%AF%BB%E4%B8%80%E5%AE%A1%E5%88%A4%E5%86%B3%E4%B9%A6%EF%BC%88%E5%9B%9B%EF%BC%89%EF%BC%9A%E9%81%97%E6%BC%8F%E7%9A%84%E7%96%91%E7%82%B9%EF%BC%881%EF%BC%89¶ms.preUserId=55122586¶ms.preUserName=%E9%87%91%E6%98%93%E6%81%92¶ms.prePostTime=1383200312000¶ms.sourceName=%E5%A4%A9%E6%B6%AF%E8%AE%BA%E5%9D%9B¶ms.type=3¶ms.bScore=true¶ms.content=11111%E4%B8%8D%E7%9F%A5%E9%81%93%E8%BF%99%E7%B1%BB%E5%B0%8F%E8%AF%B4%E9%82%A3%E9%87%8C%E6%9C%89%E6%9B%B4%E5%A4%9A%E6%9B%B4%E5%85%A8%E9%9D%A2%E7%9A%84%E3%80%82%E3%80%82%E3%80%82¶ms.title=111111%E4%B8%8D%E7%9F%A5%E9%81%93%E8%BF%99%E7%B1%BB%E5%B0%8F%E8%AF%B4%E9%82%A3%E9%87%8C%E6%9C%89%E6%9B%B4%E5%A4%9A%E6%9B%B4%E5%85%A8%E9%9D%A2%E7%9A%84%E3%80%82%E3%80%82%E3%80%82¶ms.bWeiBo=false¶ms.vCode="&guictrlread($hCheckcode)
$oIE=ObjCreate("microsoft.xmlhttp")
$oIE.Open("POST",$url,false)
$oIE.setRequestHeader("Cache-Control", "no-cache")
$oIE.setRequestHeader("Accept-Language", "zh-cn")
$oIE.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
$oIE.setRequestHeader("Referer",$url)
$oIE.Send($data)
$htm=$oIE.responseText
msgbox(0,'',$htm)
EndSwitch
WEnd
Func nRePic()
FileDelete($file)
$oIE= ObjCreate("winhttp.winhttprequest.5.1")
$oIE.open("GET", 'http://imgcode.tianya.cn/services/ImageCodeService',False)
;$oIE.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oIE.setRequestHeader("Referer", "http://passport.tianya.cn/register/default.jsp?sourceURL=http%3A%2F%2Ffocus.tianya.cn%2F")
$oIE.Send()
$HTMLSource=$oIE.ResponseBody
$oH=ObjCreate("Adodb.Stream")
$oH.Type = 1
$oH.Mode = 3
$oH.Open
$oH.write($HTMLSource)
$oH.SaveToFile($file)
$oH.Close()
GUICtrlSetImage($Pic1, $file)
FileDelete($file)
EndFunc ;==>nRePic
|