回复 6# lynfr8
鄙人之见 应该设置一个超时,否则 直接用 _IEBodyReadText ($oIE) 来判断 有的时候会出现错误
更提高效率#include <IE.au3>
$oIE = _IECreate("http://www.baidu.com/", 0, 1, 0)
If _IELoadWait($oIE, 1000, 5000) = 1 Then
$sText = _IEBodyReadText($oIE)
If StringInStr($sText, "不能链接到您请求的网页") Then
MsgBox(0,"","不能链接到您请求的网页")
Else
MsgBox(0,"","Ok")
EndIf
Else
MsgBox(0, "", @error)
EndIf
;~ @Error: 0 ($_IEStatus_Success) = 无错
;~ 1 ($_IEStatus_GeneralError) = 一般性错误
;~ 3 ($_IEStatus_InvalidDataType) = 无效数据类型
;~ 4 ($_IEStatus_InvalidObjectType) = 无效对象类型
;~ 6 ($_IEStatus_LoadWaitTimeout) = 等待加载超时
;~ 8 ($_IEStatus_AccessIsDenied) = 访问被拒绝
;~ 9 ($_IEStatus_ClientDisconnected) = 客户端断开
|