zoukankan
html css js c++ java
一个单词查询程序
<
html
>
<
hea
>
<
title
>
Words list
</
title
>
<
STYLE
TYPE
="text/css"
>
<!--
/**/
/*
$WEFT -- Created by: Alex (hezhengyu@bit.edu.cn) on 2004-6-14 --
*/
@font-face
{
}
{
font-family
:
HMPhone BDC
;
font-style
:
normal
;
font-weight
:
normal
;
src
:
url(HMPHONE0.eot)
;
}
-->
body
{
}
{
font-family
:
"Tahoma"
;
}
</
STYLE
>
</
head
>
<
body
>
<
form
action
="find.asp"
id
=form1
name
=form1>
<input name
="name"
maxlength
="15"
size
=15>
<input type
="submit"
value
="Find it"
name
="find"
>
</
form
>
<%
sql
=
"
"
name
=
request(
"
name
"
)
sql
=
"
select * from words where word like '%
"
&
name
&
"
%'"
set
rs
=
server.
createobject
(
"
adodb.recordset
"
)
conn
=
"
DBQ=
"
&
server.mappath(
"
word.mdb
"
)
&
"
;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;"
rs.open sql,conn,
1
,
1
maxperpage
=
30
rs.pagesize
=
maxperpage
if
trim
(request(
"
page
"
))
<>
""
and
isnumeric
(request(
"
page
"
))
then
currentpage
=
clng
(request(
"
page
"
))
if
currentpage
<
1
then
currentpage
=
1
elseif
currentpage
>
rs.pagecount
then
currentpage
=
rs.pagecount
end
if
else
currentpage
=
1
end
if
if
rs.eof
then
response.write
"
<p align='center'>没有这个单词</p>"
else
totalput
=
rs.recordcount
'
记录
if
currentpage
=
1
then
showpages
showcontent
else
if
(currentpage
-
1
)
*
maxperpage
<
totalput
then
rs.move(currentpage
-
1
)
*
maxperpage
dim
bookmark
bookmark
=
rs.bookmark
'
移动至开始显示的记录位置
showpages
showcontent
else
currentpage
=
1
showcontent
end
if
end
if
rs.close
end
if
set
rs
=
nothing
set
conn
=
nothing
sub
showcontent
dim
i
i
=
0
do
while
not
(rs.eof
or
err)
result
=
replace
(rs(
"
word
"
),name,
"
<font color=black>
"
&
name
&
"
</font>
"
)
response.write rs(
"
id
"
)
&
"
<font color=red><b>
"
&
result
&
"
</b></font>
"
&
"
[<font face=""HMPhone BDC"">
"
&
rs(
"
phonetic
"
)
&
"
</font>] <font color=blue face=""隶书""><b>
"
&
rs(
"
remark
"
)
&
"
</b></font><br>"
i
=
i
+
1
if
i
>=
maxperpage
then
exit
do
rs.movenext
loop
end sub
sub
showpages()
dim
n,k
if
(totalput
mod
maxperpage)
=
0
then
n
=
totalput
/
maxperpage
else
n
=
int
(totalput
/
maxperpage)
+
1
end
if
%>
Total
<%
=
rs.recordcount
%>
words.
<%
k
=
currentpage
if
k
=
1
then
response.write
"
First page Previous "
else
response.write
"
<b><a href=find.asp?name=
"
&
name
&
"
&page=1>First page</a></b> "
response.write
"
<b><a href=find.asp?name=
"
&
name
&
"
&page=
"
&
k
-
1
&
"
>Previous</a></b> "
end
if
if
k
=
n
then
response.write
"
Next Last page<br>"
else
response.write
"
<b><a href=find.asp?name=
"
&
name
&
"
&page=
"
&
k
+
1
&
"
>Next</a></b> "
response.write
"
<b><a href=find.asp?name=
"
&
name
&
"
&page=
"
&
n
&
"
>Last page</a></b><br>"
end
if
end sub
%>
</
body
>
</
html
>
演示地址
http://www.hzsghj.gov.cn/g7/data/find.asp
查看全文
相关阅读:
py计算程序运行时间-简易版
py-冒泡排序
py_冒泡排序
Python测试函数运行时间
py_二分查找
Python发送get、post请求
py_递归实例:汉诺塔问题
递归实例:汉诺塔问题
Jmeter断言实例—响应断言
第十四天-linux命令及基础知识实战
原文地址:https://www.cnblogs.com/Glory/p/23216.html
最新文章
算法导论学习-prim算法
路由器中pppoe,动态IP,静态IP的区别
算法导论学习-线段树(1)
POJ2479,2593: 两段maximum-subarray问题
IIS是如何处理ASP.NET请求的
算法导论学习-binary search tree
POJ1840: Eqs(hash问题)
POJ3349: Snowflake Snow Snowflakes(hash 表)
POJ1050:To the max
算法导论学习-子数组最大和问题
热门文章
Jmeter --- 分布式测试
Jmeter --- Http Cookie Manager
Jmeter -- HTTP Request Defaults HTTP请求默认值
Jmeter -- 属性和变量
Jmeter之逻辑控制器(Logic Controller)
Jmeter报告优化之New XSL stylesheet
Jmeter调试工具---HTTP Mirror Server
Jmeter ----Bean shell使用
jmeter --JDBC请求
jmeter ---处理Cookie与Session
Copyright © 2011-2022 走看看