关于使用XMLHTTP读取远程数据的问题~~~~~~100分相送

darker 2004-09-16 06:49:09
源代码:
<%
dim url,http,strsource
url = "http://news.xinhuanet.com/sports/2004-09/16/content_1988943.htm"
Set http =CreateObject("Microsoft.XMLHTTP")
http.Open "get",url,False
http.SetRequestHeader "Content-Type","Charset=gb2312"
http.Send()
strsource = http.ResponseText
Set http = Nothing
Response.write Server.HTMLEncode(strsource)
%>

运行后的错误:

msxml3.dll 错误 '80070005'

拒绝访问。

/t.asp,行 7

也就是send这一行出错

--------------------------

应如何解决呢?在vbscript中取此页是没有问题的,只有在ASP中才会出现的,为什么?我的MSXML是4版本,用3的版本也是一样的~
...全文
310 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
darker 2004-09-22
  • 打赏
  • 举报
回复
up--------
darker 2004-09-21
  • 打赏
  • 举报
回复
除了这一种方法,有人能告诉我,还有其它方法吗?
zehao 2004-09-21
  • 打赏
  • 举报
回复
呵呵,换一种方法试试
darker 2004-09-20
  • 打赏
  • 举报
回复
最大的问题还是没有解决,不知道问题出在哪儿了~~~~~~~~~

是否是我读取网站资料的网站做了设置啊,什么只允许域访问是什么意思~
jimlxk 2004-09-19
  • 打赏
  • 举报
回复
帮你up,我也遇到类似问题
  • 打赏
  • 举报
回复
server.createobject
跟直接用createobject是有区别的
server.createobject是指你在服务器上用,不是很耗费资源
直接用createobject,如果客户端多的话可能会使服务器死机不过用
<script>用vbscript在客户端执行就没这个问题了
darker 2004-09-17
  • 打赏
  • 举报
回复
请问各位:

CreateObject("Microsoft.XMLHTTP")

Server.CreateObject("Microsoft.XMLHTTP")

有什么区别吗?
darker 2004-09-17
  • 打赏
  • 举报
回复
感谢楼上各位你们的回复,你们说的我都试了,都不行,

并且我的ASP程序读取其它网站的数据是可以的,唯独读取www.xinhuanet.com的数据是不行的,但是如果不用ASP程序,而用VBscript而没有问题,我不知道为什么会这样呢?
darker 2004-09-17
  • 打赏
  • 举报
回复
up
ce200311 2004-09-16
  • 打赏
  • 举报
回复
'定义Function函数
'===============================================================================
Function GetPage(url)
Dim Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
End Function

Function BytesToBstr(body)
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 = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
NetVer 2004-09-16
  • 打赏
  • 举报
回复
设置msxml有everyone的权限
wanghaoran 2004-09-16
  • 打赏
  • 举报
回复
msxml3.dll 错误 '80070005'

拒绝访问。
-------------------------------------
应该是安全性问题。
lxysjl 2004-09-16
  • 打赏
  • 举报
回复
不懂
bananasmiling 2004-09-16
  • 打赏
  • 举报
回复
检查system32下msxml3.dll等的安全性是否有evryone读取权限
DeltaCat 2004-09-16
  • 打赏
  • 举报
回复
如果仍然不行的话,用这个试试

Set http = Server.CreateObject("Microsoft.ServerXMLHTTP")
....
http.Send
DeltaCat 2004-09-16
  • 打赏
  • 举报
回复
Set http = Server.CreateObject("Microsoft.XMLHTTP")
...
http.Send
孟子E章 2004-09-16
  • 打赏
  • 举报
回复
代码没有问题
检查system32下msxml3.dll等的安全性是否有evryone读取权限

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧