本帖最后由 lleheaven 于 2013-3-6 14:30 编辑
RT
我机器自己一直都没遇到,但别人的机器是xp的有的就会有这个提示,我尝试把我的机器断网话,也可以有这个对话框出来,好像是在Send 这一步出错
请问这个send 有没有什么等待或超时设置的? 是不是网络不好的话就会提示请求动作失败?
刚刚学习get post,对这个不是太懂,请大牛说说呵,谢谢Func qb_checkin($user, $pass)
$winhttp = ObjCreate("winhttp.winhttprequest.5.1")
$winhttp.Open("get", "http://www.qianwang365.com/cas/qianbaoLogin?service=http%3A%2F%2Fwww.qianbao666.com%2Fj_spring_cas_security_check", False)
$winhttp.Send()
Local $headerstr = "Set-Cookie"
$cookies = $winhttp.GetResponseHeader($headerstr)
ConsoleWrite($winhttp.GetResponseHeader($headerstr) & @CRLF)
$winhttp.Open("post", "http://www.qianwang365.com/cas/qianbaoLogin?service=http%3A%2F%2Fwww.qianbao666.com%2Fj_spring_cas_security_check", False)
$winhttp.setRequestHeader("Accept-Language", "zh-CN")
$winhttp.setRequestHeader("Cache-Control", "no-cache")
$winhttp.setRequestHeader("Connection", "Keep-Alive")
$winhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$winhttp.setRequestHeader("Cookie", $cookieDate)
$winhttp.setRequestHeader("Referer", "http://www.qianwang365.com/cas/qianbaoLogin?service=http%3A%2F%2Fwww.qianbao666.com%2Fj_spring_cas_security_check")
$winhttp.setRequestHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; HaoETV; InfoPath.3)")
$poststr = "username=" & $user & "&password=" & $pass & "<=" & $lt & "&_eventId=submit&submit=%E7%99%BB%E5%BD%95"
$winhttp.Send($poststr)
ConsoleWrite($winhttp.GetAllResponseHeaders & @CRLF)
代码一部分是这样的,是不是要在哪里加个保护呢?
找了个虚拟机的XP,调试重现了下,发现get 的没有问题, 在post 的send后就会fail~~ |