当前位置: 代码迷 >> ASP >> 急关于生成静态页面的有关问题
  详细解决方案

急关于生成静态页面的有关问题

热度:279   发布时间:2012-02-10 21:27:42.0
急!关于生成静态页面的问题.
我的数据库中有多条数据,我想通过模板把库中的记录生成到index.html中,经过尝试失败!
模板:

<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html   xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题文档 </title>
</head>

<body>
<a   href= "$File_Path$ "> $Title$ </a>
</body>
</html>

生成静态页面代码:

<!--#include   File= "Conn.asp "-->
<%
Dim   Rs
Set   Rs=server.CreateObject( "ADODB.recordset ")
Rs.open   "Select   *   from   Procducts ",Conn,1,1
Do   until   Rs.eof
Pagetitle=Pagetitle+Rs(1)& " <br> "
FilePath=FilePath+Rs(3)& " <br> "
Rs.MoveNext
loop
For   I=0   to   Rs.recordcount
Set   FSO=Server.CreateObject( "Scripting.FileSystemObject ")
Set   MyFile=FSO.OpenTextFile(Server.MapPath( "IndexTemplet.html "))
TheFile=MyFile.ReadAll
TheFile=replace(TheFile, "$Title$ ",Pagetitle)
TheFile=replace(TheFile, "$File_Path$ ",FilePath)
Set   MyFile=FSO.CreateTextFile(Server.MapPath( "Index.html "))
next
Myfile.writeLine   TheFile
MyFile.close
Set   FSO=nothing
%>
<%Response.Redirect( "Index.html ")%>

生成的页面:

<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html   xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题文档 </title>
</head>

<body>
<a   href= "200765114617.html <br> 200765115017.html <br> 200765113550.html <br> 200765114631.html <br> 200765115027.html <br> 200765115038.html <br> 200765115136.html <br> 200765120320.html <br> 200765123518.html <br> 200765123627.html <br> 200765124106.html <br> 200765124138.html <br> 200765124217.html <br> 200765132337.html <br> 200765132608.html <br> 200765132615.html <br> 200765132620.html <br> 200765132626.html <br> 200765132708.html <br> 200765132718.html <br> 200765132812.html <br> 200765132824.html <br> 200765132831.html <br> 200765132853.html <br> 200765132906.html <br> 200765132914.html <br> 200765132920.html <br> 200765132929.html <br> 200765132937.html <br> 200765132949.html <br> 200765133003.html <br> 200765133434.html <br> 200765133447.html <br> 200765133521.html <br> 200765133534.html <br> 200765133548.html <br> 200765133631.html <br> 200765133639.html <br> 200765133647.html <br> 200765133654.html <br> 200765133707.html <br> 200765133718.html <br> 200765133724.html <br> 200765133728.html <br> 200765133738.html <br> 200765133815.html <br> 200765133823.html <br> 200765133834.html <br> 200765133850.html <br> 200765133904.html <br> "> fxzdcz <br> sdfsdfsdfcxzc <br> xvxv <br> asczsczxc <br> sdfsdfsdf1 <br> sdfsdfsdf2 <br> <a> czcxz </a> <br> <a   href=@File_Path> vcxv </a> <br> dsfsdfsdfsdf <br> cxvvxcvxc <br> 你是谁? <br> 似的 <br> 思想次序形成 <br> <a   href= "@File_path "> 按时大苏打 </a> <br> 大幅度 <br> 地方反对 <br> 大幅度 <br> 地方 <br> 地方 <br> 车轴草 <br> 上海凯丰办公设备有限公司 <br> 形成形成 <br> 小 <br> 似的理发机度秒 <br> 下 <br> 须知似的 <br> zdv   <br> 知识啊 <br> zsdvzd安定法似的 <br> <br> <br> 发  <br> 发  <br> <br> 角持脸 <br> 物遥 <br> 二三 <br> 伯     <br> 伯 <br> 城厢 <br> 脾郛 <br> 用 <br> 酱豆腐功能酱豆腐经过 <br> 仍 <br> 振 <br> 手 <br> 仍 <br> 你脸手扔物  <br> 有右 <br> 直百我 <br> </a>
  相关解决方案