这个asp生成静态文件的代码哪有错误啊?急
<!--#include file="conn.asp"-->
<%
dim title,content,id
if reguest("id")="" then
id=0
else
id=reguest("id")
Dim fso,f,htmlpath,mobanpath,tmppath
Dim strTitle,strContent,strOut
'创建文件系统对象
htmlpath=Server.MapPath("html")
mobanpath=Server.MapPath("cmoban.html")
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set f=fso.OpenTextFile(Server.MapPath("cmoban.html")) '打开网页模板文件,读取模板内容
strOut=f.ReadAll
f.close
set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select top 50 * from jingdian where id > " & id & "by order by id"
rs.Open rs.Source,Conn,1,1
Do While not rs.eof '貌似这个循环有问题。不过不知道怎么错的
tmppath = htmlpath & "\" & rs("s_id") & "\" &rs("o_id") '定义路径
if not fso.folderExists(tmppath) then
fso.creasteFolder(tmppath) '创建文件夹
end if
title=rs("title")
content=rs("content")
strTitle = title
strContent= content
strOut=Replace(strOut,"$title$",strTitle) '替换strOut字符串中的$title$
strOut=Replace(strOut,"$xiangqing$",strContent) '替换
Set f=fso.CreateTextFile(tmppath&"\" & rs("id") & ".html") '创建要生成的静态页
f.WriteLine strOut '写入网页内容
f.close ' 关闭文件对象
set f=Nothing '释放文件系统对象
if not rs.eof then
rs.movenext '移到下一个记录
end if
Loop
id=rs("id") '记录当前已创建了的ID值用于下页更新
rs.close
set rs=nothing
set fso=Nothing
%>
<%
Response.Write ("已更新了" & id & "个景点信息!")
%>
<script language="javascript">
location="updataall.asp?id=<% = id %> " ;
</script>
<%
dim title,content,id
if reguest("id")="" then
id=0
else
id=reguest("id")
Dim fso,f,htmlpath,mobanpath,tmppath
Dim strTitle,strContent,strOut
'创建文件系统对象
htmlpath=Server.MapPath("html")
mobanpath=Server.MapPath("cmoban.html")
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set f=fso.OpenTextFile(Server.MapPath("cmoban.html")) '打开网页模板文件,读取模板内容
strOut=f.ReadAll
f.close
set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select top 50 * from jingdian where id > " & id & "by order by id"
rs.Open rs.Source,Conn,1,1
Do While not rs.eof '貌似这个循环有问题。不过不知道怎么错的
tmppath = htmlpath & "\" & rs("s_id") & "\" &rs("o_id") '定义路径
if not fso.folderExists(tmppath) then
fso.creasteFolder(tmppath) '创建文件夹
end if
title=rs("title")
content=rs("content")
strTitle = title
strContent= content
strOut=Replace(strOut,"$title$",strTitle) '替换strOut字符串中的$title$
strOut=Replace(strOut,"$xiangqing$",strContent) '替换
Set f=fso.CreateTextFile(tmppath&"\" & rs("id") & ".html") '创建要生成的静态页
f.WriteLine strOut '写入网页内容
f.close ' 关闭文件对象
set f=Nothing '释放文件系统对象
if not rs.eof then
rs.movenext '移到下一个记录
end if
Loop
id=rs("id") '记录当前已创建了的ID值用于下页更新
rs.close
set rs=nothing
set fso=Nothing
%>
<%
Response.Write ("已更新了" & id & "个景点信息!")
%>
<script language="javascript">
location="updataall.asp?id=<% = id %> " ;
</script>
...全文
相关推荐
Nginx静态文件响应POST请求 提示405错误的解决方法
Apache、IIS、nginx等绝大多数web服务器,都不允许静态文件响应POST请求,否则会返回“HTTP/1.1 405 Method not allowed”错误
Asp.net生成htm静态文件
一个Asp.net生成htm静态文件的实例.
ASP生成二维码代码
ASP生成二维码,不过不好用,还是DEMO版本,建议需要的下载参考一下就行了,没有实用价值。
Asp Access 创建静态文件/HTML
作用说明: 本代码实现从 Access 提取数据以创建 HTML 文件, 不建文件夹. 如果文件名与要创建的文件名相同, 则覆盖, 跟 SQL 的更新一样的原理. 待加功能: 删除与查找. 代码如下:<% ”””””””””””””””””””””””””””””””””””” ‘ ‘ subject : Asp 创建静态文件/HTML By Stabx ‘ ‘ writer : Stabx<shawl> ‘ ‘ blog : http://btbtd.exblog.jp/ ; ‘ ‘ blog/site : Phoenix.GI – P.GI / \ 绿色
ASP的错误代码都有哪些?
有关ASP的错误代码的只是,献给需要的人


