在 replace 一个生成文件名的标签 用 include file 包含入生成的shtml页 或者只写入一个页面 一次生成 方便删除生成的页面 同理 可以用这样的方法生成 index_1.html index_2.html ...... 生成的 list_1.html ...list_2.html .... 或者后缀为 .shtml replace 字符串替换标签<$list$>想知道页页列表 <$pages$>分页 response.write"列表已全部生成!" next fl_w.close:set fl_w=nothing fl_w.write(html) '相比看列表生成文件名 list_1.htm,list_2.html ,ist_3.html... set fl_w=fso.createtextfile(server.mappath("list_"&i&".html"),true) html=replace(html,"<$pages$>",pages) html=replace(html,"<$list$>",list) fl_w.close:set fl_w=nothing html=fl_w.readall() set fl_w=fso.opentextfile(server.mappath("template.html")) '学习生成模板页路径 在模板需要的地方使用标签 set fso=server.createobject("scripting.filesystefrommobject") next response.write "<a href='list_"&j&".ht对于页面ml"&"'>"&"list_"&j&"</a>" pages=pages&"<a href='list_"&j&".html"&"'>"&j&"</a>" for j=1 to pcount pages=pages&chr(13) pages="" loop rs.movenext list=list&"<li><a href='"&rs("newsID")&".html'>"&rs("Title")&"</a></li>" do while not rs.eof list=list&chr(13) list="" rs.open sql,conn,1,1 set rs=server.createobject("adodb.recordset") end if sql="select top "&psize&" * from products where newsid> (select max(newsID) from (select top "&psize*(i-1)&" newsid from products) as maxid)" else sql="select top "&psize&" * from products" if i=1 then for i=1 to pcount end if set rs=nothing rs.close pcount=ceiling(rscount/psize)''*计算总页数 rscount=rs(0) else response.end response.write"没有记录, set rs=nothing rs.close producif rs.eof then set rs=conn.exe看着生成cute(sql) sql="select count(*) from products" psize=1看看producp> end function end if ceiling=str else ceiling=str1+1 if str-str1>0 then str1=int(str) function ceiling(str) conn.open connstr set conn=Server.Createobject("ADODB.Connection") connstr="driver={SQL server};server=(local);uid=sa;pwd=;database=date" on error resume next dim conns听听*tr dim conn ------------------------------------- <$pages$> </div> </ul> <$list$> <ul> <div id="n我不知道分页av"> <link rel="stylesheet" type="text/css" href="css/style.css" /> template.html 看看原理对于list 静态生成LIST列表以及静态生成分页页面原理 相比看produc 成分静态生成LIST列表以及静态生成分页页面原理 听听from 静态 你知道静态 相比看以及 (责任编辑:admin) |