找回密码
 加入
搜索
查看: 3027|回复: 3

[网络通信] $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")怎么刷新

  [复制链接]
发表于 2012-11-5 08:48:14 | 显示全部楼层 |阅读模式
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET","http://xxx.com/diary.asp?action=state")
$oHTTP.Send()
$HTMLSource = $oHTTP.Responsetext
MsgBox(0,0,$htmlsource)

第一次调用上面的函数后,网页内容发生了改变,第二次调用上面的函数,得到的结果没有刷新,怎么回事?怎么解决?
发表于 2012-11-5 12:25:03 | 显示全部楼层
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$url="http://xxx.com/diary.asp?action=state"&"&r="random()
$oHTTP.Open("GET",$url)
$oHTTP.Send()
$HTMLSource = $oHTTP.Responsetext
MsgBox(0,0,$htmlsource)
发表于 2012-11-5 16:04:01 | 显示全部楼层

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET","http://xxx.com/diary.asp?action=state")
$oHTTP.Send()
$oHTTP.Open("GET","newaddress")
$oHTTP.Send()
$HTMLSource = $oHTTP.Responsetext 
MsgBox(0,0,$htmlsource)
发表于 2012-11-5 20:29:30 | 显示全部楼层
httprequest对象不像xmlhttp,多次请求相同地址不存在沉余问题,试试添加头 $oHTTP.setRequestHeader("If-Modified-Since", "0")
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-3 04:28 , Processed in 0.075429 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表