zhaicheng Posted February 16, 2011 Share Posted February 16, 2011 $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Send() When connecting speed is bad,my code is having a problem- Action Faild,and then Autoit collaps. Is there any way to avoid this error? Maybe using if @error?How to use it? Link to comment Share on other sites More sharing options...
Gideon Posted February 16, 2011 Share Posted February 16, 2011 http://msdn.microsoft.com/en-us/library/aa384106.aspx read onerror Many times you need to think like hobby-bob:') Link to comment Share on other sites More sharing options...
zhaicheng Posted February 16, 2011 Author Share Posted February 16, 2011 I have read it,still,I don't know how to handle it?Would you please elaborate? Thanks! Link to comment Share on other sites More sharing options...
zhaicheng Posted February 16, 2011 Author Share Posted February 16, 2011 $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 Link to comment Share on other sites More sharing options...
zhaicheng Posted March 5, 2011 Author Share Posted March 5, 2011 Gideon ,I really appreciate all your kind help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now