microsoft.xmlhttp 請求的網址或文件不存在如何處理
本帖最后由 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 對話框,該怎麼處理呢~ 謝謝 $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
找到,也是管理員的 :face (24):
页:
[1]