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

microsoft.xmlhttp 請求的網址或文件不存在如何處理

[复制链接]
发表于 2009-5-31 08:01:02 | 显示全部楼层 |阅读模式
本帖最后由 registerboy 于 2009-5-31 15:25 编辑

Func _XmlHttp($Url)                           

Local $oHTTP,$sReturn

$oHTTP = ObjCreate("microsoft.xmlhttp")
$oHTTP.Open("get",$Url,false))

$oHTTP.Send()

$sReturn=BinaryToString($oHTTP.responseBody)

Return $sReturn

EndFunc

管理員的東東, 如果那個網址不存在或者文件不存在, 出現
Line-1:
Error: The requested action with this object has failed.

不想有這個ERROR 對話框,該怎麼處理呢~ 謝謝
 楼主| 发表于 2009-5-31 15:25:01 | 显示全部楼层
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")


$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$a=$oHTTP.Open("GET","http://kds.zj.com")
$oHTTP.Send()
$HTMLSource = $oHTTP.Responsetext
MsgBox(0,'',$HTMLSource)

Func MyErrFunc()
   $HexNumber=hex($oMyError.number,8)
   Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _
                "Number is: " & $HexNumber & @CRLF & _
                "Windescription is: " & $oMyError.windescription )

   $_eventerror = 1
Endfunc

找到,也是管理員的
发表于 2009-7-26 14:17:49 | 显示全部楼层
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-2 20:27 , Processed in 0.070366 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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