Vbscript msxml12.XMLHTTP error handling
问题 I use this vbscript code, to download web page: Dim oXML Set oXML = CreateObject("msxm12.XMLHTTP") oXML.Open "GET", "mysite.com", False oXML.Send If there is no such web site, I get an error 80004005, Unspecified error at line "oXML.Open ..." How can I handle this error in vbscript? I want to catch this error and show msgbox with my error, i.e. web page is not available. 回答1: There are at least three possible points of failure in your script. CreateObject may fail; e.g. if you use msxml12