例
Set XmlHttp2 = CreateObject("Msxml2.XMLHTTP")
XmlHttp2.Open "GET", Url, True
XmlHttp2.setRequestHeader "CONTENT-TYPE", "application/json;charset=utf-8"
XmlHttp2.send PostMsg
1、使用MSXML2.XMLHTTP open中参数设置为True
2、onreadystatechange 进行设置
方式有:1)使用Timer
2)WithEvents声明的DomDocument对象load Xml
3)自定义类,新建类方法来处理事件,然后把类赋给XMLHTTP对象的OnReadyStateChange事件
3、详细内容参考MSDN
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms757030(v=vs.85)
Use the onReadyStateChange Property (Visual Basic)
- 10/27/2016
- 4 minutes to read
This topic discusses the implementation details necessary to use
onreadystatechangenotification in Microsoft Visual Basic applications.Background Information for onReadyStateChange events
The
onreadystatechangecallback function was not implemented as a COM automation event in theIXMLHTTPRequestandIServerXMLHTTPRequestcomponents. This is because these components are heavily used in scripting environments, many of which do not support COM events. Theonreadystatechangecallback function was intended to be easy to use when working with scripting clients such as VBScript and JScript.Because the
onreadystatechangeproperty was not implemented through COM-based automation events, Visual Basic (and C/C++) applications need to implement thi

最低0.47元/天 解锁文章
2856

被折叠的 条评论
为什么被折叠?



