找回密码
 加入
搜索
查看: 2130|回复: 2

[IE类操作] 解决winhttp连接超时最低4秒的问题

[复制链接]
发表于 2016-6-20 21:43:16 | 显示全部楼层 |阅读模式
$T1 = TimerInit()
$geturl = "http://facebook.com"  ;上不去的网站
$WinHttp = ObjCreate("WinHttp.WinHttprequest.5.1")
$WinHttp.SetTimeouts(100, 100, 100, 100) ;设置操作超时时间,设置的再低,最低都要4秒钟才返回。
$WinHttp.Open("GET", $geturl, False)
$WinHttp.Send()
$WinHttp.WaitForResponse
$body = BinaryToString($WinHttp.Responsebody, 1)
MsgBox(64, Round(TimerDiff($T1)), $body)

;如何让这个连接2秒钟收不到数据就关闭?
发表于 2016-6-21 14:31:20 | 显示全部楼层
回复 1# elexy


    先判斷 再連接

http://www.autoitx.com/forum.php ... hlight=%D7%EE%BF%EC
发表于 2016-6-24 17:17:59 | 显示全部楼层
WinHttp.WinHttprequest 用这个也只能这样了.
发表于 2016-6-25 23:22:26 | 显示全部楼层
WinHttprequest 用这个
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-20 20:43 , Processed in 0.083909 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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