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
查看全文
相关阅读:
环境变量配置1
Golang 类型转换,断言和显式强制转换
Goland could not launch process: decoding dwarf section info at offset 0x0: too short 解决方案
用puttygen工具把私钥id_rsa转换成公钥id_rsa.ppk
JetBrains GoLand 2018 激活码/ 注册码(最新破解方法)
Go学习笔记(只有链接)
linux中的ftp命令
Linux的学习之路
like语句百分号前置会使用到索引吗?
记录下每月生活开支
原文地址:https://www.cnblogs.com/Glory/p/23216.html
最新文章
阵列式摄像头
MHz 和 Mbps的区别
免费开源的android项目分享
MIPI D-PHY 总结
MIPI D-PHY 简写收集
NSDate & NSDateFormatter
NSArray 迭代
NSArray 数组排序
NSArray 利用数组创建数组
NSArray 初始化
热门文章
Centos硬件信息查看命令
Linux下安装nginx
CentOS安装JAVA后JAVA版本不对的问题
阿里云服务器被侵入记录
centos杀死进程命令
Sublime 版本
查看VSCode版本
FileZilla FTP Client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
mysql配置完环境变量后 net start mysql 服务名无效
Copyright © 2011-2022 走看看