| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 511 人关注过本帖
标题:生成静态首页出错。。求大神指导。。。
只看楼主 加入收藏
lhxf1314
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-7-13
收藏
 问题点数:0 回复次数:0 
生成静态首页出错。。求大神指导。。。
错误类型:
Server 对象, ASP 0177 (0x8007007E)
8007007e
/admin_ht/scsy.asp, 第 39 行

39行代码:Set Fileobject=Server.CreateObject("scripting.filesystemobject")

scsy.asp全部代码如下:
<%

'常用函数
'1、输入url目标网页地址,返回值getHTTPPage是目标网页的html代码
function getHTTPPage(url)
set Http=server.CreateObject("MSXML2.XMLHTTP")
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.Clear
end function

'2、转换乱码,直接用xmlhttp调用有中文字符的网页得到的将是乱码,可以通过
'adodb.stream组件进行转换
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%>
<%

txtURL="http://localhost/index_s.asp"

sText = getHTTPPAGE(txtURL)

Set Fileobject=Server.CreateObject("scripting.filesystemobject")
filename="index.asp"
set openfile=fileobject.opentextfile(server.MapPath("../"&filename),2,true)'true为不存在自行建立
openfile.writeline(sText)
set openfile=nothing
%>
<script>
alert("操作成功")
window.location.href="main.asp"
</script>
搜索更多相关主题的帖子: function 网页 
2014-04-29 08:37
快速回复:生成静态首页出错。。求大神指导。。。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014329 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved