zoukankan
html css js c++ java
ASP生成.shtml.html,多页
<
!
--
#include file
=
"
conn.asp
"
-->
<
html
><
head
><
TITLE
>
分页测试
</
TITLE
><
LINK href
=
"
inc/style.css
"
type
=
text
/
css rel
=
stylesheet
></
head
>
<
%
dim
strhead,sql,totalpage,j,whichpage,howmanyrecs,str0,ref,counter,yyyy
strHead
=
strHead
&
"
<html>
"
strHead
=
strHead
&
"
<head>
"
strHead
=
strHead
&
"
<TITLE>分页测试</TITLE>
"
strHead
=
strHead
&
"
<LINK href=""inc/style.css"" type=text/css rel=stylesheet>
"
strHead
=
strHead
&
"
</head>
"
%
>
<
%
yyyy
=
5
sql
=
"
select * from news order by atime desc
"
set
rs
=
server.createObject(
"
ADODB.Recordset
"
)
rs.open sql,conn,
1
,
1
%
><
%
rs.pagesize
=
yyyy
totalpage
=
rs.pagecount
rs.close
set
rs
=
nothing
for
j
=
1
to
totalpage
sql
=
"
select * from news order by atime desc
"
set
rs
=
server.createObject(
"
ADODB.Recordset
"
)
rs.open sql,conn,
1
,
1
whichpage
=
j
rs.pagesize
=
yyyy
totalpage
=
rs.pagecount
rs.absolutepage
=
whichpage
howmanyrecs
=
0
%
><
%
str0
=
""
str0
=
str0
&
"
</p>
"
str0
=
str0
&
"
<table bgcolor=#cecfce align=center border=0 width=800 cellpadding=2 cellspacing=1>
"
%
><
%
do
while
not
rs.eof
and
howmanyrecs
<
rs.pagesize
%
><
%
str0
=
str0
&
"
<tr bgcolor=#f7f7f7>
"
str0
=
str0
&
"
<td bgcolor=#f7f7f7 align=""center""><a href=
"
&
rs(
"
address
"
)
&
"
>
"
&
rs(
"
name
"
)
&
"
</a></td>
"
str0
=
str0
&
"
<td bgcolor=#f7f7f7 align=""center"">
"
&
rs(
"
atime
"
)
&
"
</td>
"
str0
=
str0
&
"
<td bgcolor=#f7f7f7 align=""center"">
"
&
rs(
"
text
"
)
&
"
</td>
"
str0
=
str0
&
"
</tr>
"
%
><
%
rs.movenext
howmanyrecs
=
howmanyrecs
+
1
loop
rs.close
set
rs
=
nothing
%
><
%str0
=
str0
&
"
</table>
"
%
><
%
'
分页部分
ref
=
""
ref
=
ref
&
"
<br>
"
ref
=
ref
&
"
<table bgcolor=#cecfce align=center border=0 width=800 cellpadding=0 cellspacing=1>
"
ref
=
ref
&
"
<tr bgcolor=#f7f7f7>
"
ref
=
ref
&
"
<td>
"
ref
=
ref
&
"
<b>Pages:
"
&
j
&
"
/
"
&
totalpage
&
"
</b>
"
ref
=
ref
&
"
</td>
"
ref
=
ref
&
"
<td>
"
ref
=
ref
&
"
<a href=list_1.html
"
&
"
>
"
&
"
<FONT face=Webdings>9</FONT>
"
&
"
</a>
"
if
whichpage
=
1
then
ref
=
ref
&
"
<FONT face=Webdings>7</FONT>
"
else
ref
=
ref
&
"
<a href=list_
"
&
j
-
1
&
"
.html
"
&
"
>
"
&
"
<FONT face=Webdings>7</FONT>
"
&
"
</a>
"
end
if
for
counter
=
1
to
totalpage
ref
=
ref
&
"
<a href=list_
"
&
counter
&
"
.html
"
&
"
>[
"
&
counter
&
"
]</a>
"
ref
=
ref
&
"
"
if
counter
mod
10
=
0
then
ref
=
ref
&
"
<br>
"
end
if
next
if
(whichpage
>
totalpage
or
whichpage
=
totalpage)
then
ref
=
ref
&
"
<FONT face=Webdings>8</FONT>
"
else
ref
=
ref
&
"
<a href=list_
"
&
j
+
1
&
"
.html
"
&
"
>
"
&
"
<FONT face=Webdings>8</FONT>
"
&
"
</a>
"
end
if
ref
=
ref
&
"
<a href=list_
"
&
totalpage
&
"
.html
"
&
"
>
"
&
"
<FONT face=Webdings>:</FONT>
"
&
"
</a>
"
Dim
fso,f
Dim
strTitle,strContent,strOut
'
创建文件系统对象
Set
fso
=
Server.CreateObject(
"
Scripting.FileSystemObject
"
)
Set
f
=
fso.CreateTextFile(Server.MapPath(
"
list_
"
&
j
&
"
.html
"
),
true
)
'
写入网页内容
f.WriteLine strHead
&
str0
&
ref
f.close
response.write
"
正在生成第
"
&
j
&
"
个页面!<br>
"
%
><
%
next
%
>
查看全文
相关阅读:
注册表设置开机启动
Sql Server 行转列、列转行
[转]JavaScript继承详解
创建开机启动项快捷方式
【转】IEnumerable与IEnumerator区别
[转]winform缩放时,控制控件的比例
【转】反射调用性能比较
Unity Ioc 学习笔记1
【转】深入探析c# Socket
【转】BOOL和bool的区别
原文地址:https://www.cnblogs.com/zwl12549/p/863634.html
最新文章
博客园添加鼠标粒子吸附特效 brady
Linux学习笔记之Shell Scripts
常见Http协议状态码
新项目,关于NC
4月30写工作总结,不要忘了!!filter数量不对!
工作
VC远程访问数据库
爱的格言
DSHOW编译错误:strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A)
交流贴
热门文章
根据clsid取得取得filter
(转)寻找生命小意义——我的价值观和理想
PCR的工作原理
WebService应用实列
引用和指针的对比
C# 创建互斥程序_只允许运行一个程序实例
【转】C#设计模式(外观模式)
【转】C#设计模式(适配器模式)
【转】Mutex和Semaphore区别
SQL 触发器
Copyright © 2011-2022 走看看