msxml3.dll 错误 '80070005'
拒绝访问。
问题还原
经过一番分析,提取出了主要的代码:
<%
'编码转换
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
'获取全部内容
Function HttpGet(weburl)
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "GET", weburl, False, "", ""
.Send
HttpGet = .ResponseBody
End With
HttpGet = BytesToBstr(HttpGet,"GB2312")
Set Retrieval = Nothing
End Function
Response.Write(HttpGet("http://member1.taobao.com/member/userProfile.jhtml?userID=huxueqi2011"))
%>运行结果:

解决方法
将代码中Microsoft.XMLHTTP替换成Msxml2.ServerXMLHTTP即可。
原因分析
通过Firebug发现访问上边url时有个302跳转:

于是尝试在服务器建立一个302跳转页面希望对问题进行重现:
Redirect.asp:
<%
Response.Status="302 Moved Temporarily"
Response.AddHeader "Location","http://www.qq.com/"
Response.End
%>遗憾的是问题没有再次出现,所以具体的错误原因暂且不知。
评论(0)
暂无评论。