XMLHTTP方法读取网页的问题
下面这段代码可以正常使用,但是如果用来传相同的参数给一个网址后,每出都返回的是相同的结果,
更换一个参数,再换回原参数后,返回结果就变了,是怎么回事
传参数的网址,在浏览器访问的话,每次返回基本都是不一样的,
遇到过这种情况的请帮忙看看,怎么清空XMlhttp方法的缓存结果
'引用 xml3.0Option ExplicitPrivate Sub Form_Load() Text1.Text = getHTTPPage("http://www.baidu.com")End SubFunction getHTTPPage(URL) '从网络读取文件 On Error Resume Next Dim http Set http = CreateObject("MSXML2.ServerXMLHTTP") http.setTimeouts 10000, 10000, 10000, 10000 http.Open "GET", URL, False http.send If http.readyState <> 4 Then Exit Function End If getHTTPPage = BytesToBstr(http.responseBody, "GB2312") Set http = Nothing If Err.Number <> 0 Then Err.ClearEnd FunctionFunction BytesToBstr(body, Cset) '从网络读取文件 Dim objstream Set objstream = CreateObject("adodb.stream") With objstream .Type = 1 .Mode = 3 .Open .Write body .Position = 0 .Type = 2 .Charset = Cset BytesToBstr = .ReadText .Close End With Set objstream = NothingEnd Function