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
%
>
查看全文
相关阅读:
URAL——DFS找规律——Nudnik Photographer
URAL1353——DP——Milliard Vasya's Function
URAL1203——DPor贪心——Scientific Conference
递推DP HDOJ 5389 Zero Escape
区间DP UVA 1351 String Compression
树形DP UVA 1292 Strategic game
Manacher HDOJ 5371 Hotaru's problem
同余模定理 HDOJ 5373 The shortest problem
递推DP HDOJ 5375 Gray code
最大子序列和 HDOJ 1003 Max Sum
原文地址:https://www.cnblogs.com/zwl12549/p/863634.html
最新文章
创建后表的修改:添加列+修改列+删除列+重命名表+删除整张表+删除整个数据库
CRUD的操作,增删改查!
注释在写代码的过程中非常重要,好的注释能让你的代码读起来更轻松,在写代码的时候一定要注意注释的规范。
UVA11324 The Largest Clique(DP+缩点)
UVALive-4287 Proving Equivalences 有向图的强连通分量+缩点
Codeforces Round #343 (Div. 2) D
codeforces629C Famil Door and Brackets (dp)
Codeforces Round #343 (Div. 2) B. Far Relative’s Problem
Codeforces Round #343 (Div. 2) A. Far Relative’s Birthday Cake
poj 2528 线段树 离散化的小技巧
热门文章
POJ 3468 A Simple Problem with Integers 线段树 区间更新
HDU 1754 I Hate It 线段树 单点更新 区间最大值
HDU 1166 敌兵布阵 线段树区间求和 更改
URAL1017——DP——Staircases
URAL1073——DP——Square Country
Codeforces Round #302 (Div. 2)——C dp—— Writing Code
Codeforces Round #302(Div. 2)——B—— Sea and Islands
Codeforces Round #302 (Div. 2)——A—— Set of Strings
高精度模板
URAL1002——DP——K-based Numbers. Version 2(未AC)
Copyright © 2011-2022 走看看