区别在于:
Msxml2.DOMDocument
Msxml2.XMLHTTP
当然,另一个问题是,谁能最好地为我服务,如下文所述?
上下文是这样的 - 我有代码可以多次调用来检索网页。 我正在寻找此任务最有效的对象。 例如, 例如 :
Dim oXmlHttp : Set oXmlHttp = CreateObject("MSXML2.XMLHTTP")
oXmlHttp.Open "GET", sUri, False
oXmlHttp.Send
If Err Then
getWebPage = "ERROR - could not get the source text of the webpage."
Exit Function
End If
sResponse = oXmlHttp.responseBody
如果我用以下方法创建一个对象,这似乎同样有效:
Dim oXmlHttp : Set oXmlHttp = CreateObject("MSXML2.XMLHTTP")
有没有人能解释或指给我一个明确概述其中每一种差异(和预期用途)的提法?