用xmlhttp组件模拟注册登陆为何会失败
有一个下载站,我用xmlhttp组件模拟注册用户的过程,可以注册成功,也可以登陆,但是和用正常渠道注册的用户相比较,前者不送注册的积分,把xmlhttp组件模拟注册时返回的成功信息,我仔细看了一下,和正常渠道注册时返回的成功信息有差别,那就是xmlhttp组件模拟注册时无论我注册的用户名是什么,他的成功信息中显示的用户名都是:nastrq.
一句话,我的模拟登陆肯定被服务器检测了出来,网站允许我注册成功,但是却不送积分,所以这个注册就毫无意义了。
代码贴出:
Set http = CreateObject("winhttp.winhttpRequest.5.1")Function regYangGuang() Dim retval, xmlmessage xmlmessage = "username=" & username & "&" xmlmessage = xmlmessage & "password=" & password & "&" & "pwdconfirm=" & password & "&" xmlmessage = xmlmessage & "ourl=" & ourl & "&" & "msn=" & msn & "&" & "email=" & email & "&" xmlmessage = xmlmessage & "select1=" & select1 & "&" & "privacy=0&"[color=#FF0000] 'xmlmessage = xmlmessage & "imagesubmit.x=41&imagesubmit.y=17&"[/color] xmlmessage = xmlmessage & "answer=" & answer & "&question=" & answer xmlmessage = xmlmessage & "&qq=" & qq xmlmessage = xmlmessage & "&Country=" & Country & "&Province=" & Province & "&City=" & City[color=#FF0000]'以上全部post的数据是用httpwatch工具抓取的,除了imagesubmit.x和imagesubmit.y不正确’其它的都没问题。这个imagesubmit是提交按钮图片,我不知道imagesubmit的坐标是如何生成的。 [/color] http.open "POST", strurl, False http.Option(4) = 13056 http.Option(6) = False http.setrequestheader "CONTENT-TYPE", "application/x-www-form-urlencoded" http.setrequestheader "Referer", "http://www.pallasa.com/user/User_Login.asp" http.send (xmlmessage) retval = BytesToBstr(http.responsebody, "gb2312") If http.Status = 200 Then Debug.Print retval End If regYangGuang = http.StatusEnd Function