| 偷页面 报错 |
| [ 来源:ITWENKU 时间:2006-9-18 18:36:05 | 浏览:185人次
] |
| |
<% Server.Scripttimeout=9999999 'on error resume next weburl="http://www.digjoy.com" 'response.Write weburl&"<hr>" newbody=getBody(weburl)'用函数取到动态页地址的内容 'response.Write newbody function getBody(infopageurl) '功能:取得指定网址的html代码 '参数:infopageurl 网页地址 if infopageurl<>"" then dim xmlHttp set xmlHttp=server.createobject("MSXML2.XMLHTTP")'声明XMLHTTP对象 xmlHttp.open "GET",infopageurl,false xmlHttp.send'上面这两就句就是调用的形式,调用后程序会堵塞在send这句,直到内容被返回。 On Error Resume Next If xmlHttp.Status<>200 then Set xmlHttp=Nothing end if getBody=BytesToBstr(xmlhttp.responsebody,"GB2312")'然后通过xmlhttp.responsebody属性将返回内容读出,这里用到一个BytesToBstr函数将在后面说明。 set xmlHttp=nothing end if end function 'BytesToBstr函数 编码转换 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
服务器是 windows 2003 + iis 6.0
报的错 "没有权限" 指的是 "xmlHttp.open "GET",infopageurl,false" 出错 我已经打开了fso的权限
请问是怎么会事
ie6.1 以上加强了对 XMLHTTP 的权限管理,不是一个域的无法访问了
同上
是在一个域下哈
|
|
 |
最新更新 |
|