首页 | 心情日记 | 建站心得 | 编程技术 | 大盘分析 | 股市信息 | 学习园地 | 电脑技巧 | 物流外贸 | 另类其它 | 站长推荐 | 给我留言 | 相册

用户登陆
用户:
密码:
 
不保存保存一天
保存一月保存一年

站点日历
73 2024 - 4 48
 123456
78910111213
14151617181920
21222324252627
282930


站点统计

最新评论

日志搜索

 标题   内容


10行代码让你告别Arp作恶导致的掉线 让人感动的家长会
未知 ASP批量生成静态页   [ 日期:2009-09-03 17:30:26 ]   [ 来自:本站原创 ]

海外邮件中继,海外退信中继,美国高速VPS,不限流量VPN,邮局维护和管理,邮件网关,EMOS邮件中继,POSTFIX邮件中继,Winwebmail邮件中继,Winmail邮件中继,DBMail邮件中继,JDMail邮件中继,Exchange邮件中继,MDaemon邮件中继 淘宝店:http://shantan.taobao.com 云邮科技官网:www.yunrelay.com

【字体设置:
代码如下
<!--#include file="conn.asp"-->
<HTML><HEAD><TITLE>生成页面</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="style.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.3020" name=GENERATOR>
</HEAD>
<BODY bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0>
<BR style="OVERFLOW: hidden; LINE-HEIGHT: 3px">
<%
dim id
id=cint(request.querystring("id"))
if id="" then
id="1"
else
id=cint(request.querystring("id"))
end if
Dim totalnumber
sql="select id from table order by id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
rs.Movefirst
if not rs.eof then
TotalNumber=rs.recordcount
end if
获取总数可以用一句代码代替,这个相信朋友自己可以解决.
rs.close
set rs=nothing
Response.Write "<br><br>" & vbNewLine
Response.Write "<table width='400' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbNewLine
Response.Write " <tr>" & vbNewLine
Response.Write " <td height='50'>总共 <font color='blue'><b>" & totalnumber & "</b></font> 个页面,正在生成第 <font color='red'><b>" & ID & "</b></font> 个页面…… </td>" & vbNewLine
Response.Write " </tr>" & vbNewLine
Response.Write "</table>" & vbNewLine
Response.Flush
If ID > totalnumber Then
Response.Write "恭喜您操作成功!"
Response.Flush
End If
creat(ID)
id=id+1
Response.Write "<meta http-equiv=""refresh"" content=""1;url=?ID="&id&""">"
%>
</BODY> 
</HTML>
<%
Function creat(id)
sql="SELECT * from table where id="&ID
set rs=conn.execute(sql)
dim name
name=rs("name")
conn.execute(sql)
rs.close
set rs=nothing
dim fso
dim znwl
dim art
dim fw
set fso=createobject("scripting.filesystemobject")
set znwl=fso.opentextfile(server.mappath("模板页"))
art=znwl.readall
znwl.close
art=replace(art,"{$name$}",name)
set fw=fso.createtextfile(server.mappath("生成页存放位置及页面名称"),true)
fw.writeline art
fw.close
set fso=nothing
End Function
%>
另外还有一种方法比上面的方法快,但是占用CPU比较多,我的空间用下面的方法老出问题
<!--#include file="conn.asp"-->
<HTML><HEAD><TITLE>生成页面</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="style.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.3020" name=GENERATOR>
</HEAD>
<BODY bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0>
<BR style="OVERFLOW: hidden; LINE-HEIGHT: 3px">
<table border="1" width="100%" id="table1">
<tr>
<td>
<%
dim allid,ppp,id,totalnum
sql="select * from table order by id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof 
if allid="" then allid= rs("id") else allid= allid & ";" & rs("id") 
rs.movenext 
loop
else
If Rs.bof And Rs.EOF Then
Response.Write "还没有找到任何文章!"
End if
end if
rs.close
set rs=nothing
allid=";"+allid
ppp=split(allid,";")
totalnum=ubound(ppp)
for id=1 to totalnum
Session("id")=Session("id")+1
creat(id)
response.write "正在生成znwl_"&id&".htm...<br>"
next
%>
</td>
</tr>
</table>
</BODY> 
</HTML>
<%
Function creat(id)
sql="SELECT * from table where id="&ID
set rs=conn.execute(sql)
dim name
name=rs("name")
conn.execute(sql)
rs.close
set rs=nothing
dim fso
dim znwl
dim art
dim fw
set fso=createobject("scripting.filesystemobject")
set znwl=fso.opentextfile(server.mappath("模板页"))
art=znwl.readall
znwl.close 
%>
art=replace(art,"{$name$}",name)
set fw=fso.createtextfile(server.mappath("生成页存放位置及页面名称"),true)
fw.writeline art
fw.close
set fso=nothing
End Function
这种方法快,但是你的空间要不受限制

暂时没有评论
   发表评论 - 不要忘了输入验证码哦!
作者: 用户:  密码:  我要注册 验证码: 
为防止广告注册机程序,验证码不会自动显示,请点击此处显示或者(刷新)验证码!
评论:

禁止表情
禁止UBB
禁止图片
识别链接
识别关键字
确定发布?
最多可以输入200个字,目前你已经输入了0个字;你今日还可以发表10条评论!
 
   

CopyRight © 2008-2010 广东金融学院030904班 All Rights Reserved
Powered by www.030904.com