日期:2014-05-17  浏览次数:20796 次

XMLHTTP 如何设置超时!
RT

有人说用MSXML2.ServerXMLHTTP可以设置超时,可是根本无法创建这个对象,如果想用这个该装什么,奇怪了msxml6.0   难道还不行

------解决方案--------------------
装MSXML Parser 4.0

Dim xmlServerHttp As New Msxml2.ServerXMLHTTP40
Dim lResolve, lConnect, lSend, lReceive As Long
lResolve = 5 * 1000
lConnect = 5 * 1000
lSend = 15 * 1000
lReceive = 15 * 1000
xmlServerHttp.setTimeouts lResolve, lConnect, lSend, lReceive
xmlServerHttp.open "GET ", "http://localhost/sample.xml ", False
xmlServerHttp.send

------解决方案--------------------
也可以不用超时,判断返回值不就成了.
如200表示正常打开等.