<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>asp分页程序</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 12px}
-->
</style></head>
<body>
<p>
<table width="186" height="39" border="1" cellpadding="0" cellspacing="0">
<tr>
<td>姓名</td>
<td>密码</td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("zheng.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql="select * from user"
rs.open sql,conn,1,2
rs.pagesize=6 '设置页面显示得页数
if request("page")<>"" then
epage=cint(request("page"))
if epage<1 then epage=1
if epage>rs.pagecount then epage=rs.pagecount
else
epage=1
end if
rs.absolutepage=epage
for i=0 to rs.pagesize-1
if rs.bof or rs.eof then exit for
%><tr>
<td><%=rs("name")%></td>
<td><%=rs("pass")%></td>
</tr>
<%
rs.movenext
next
%>
</table>
<div align="left"><span class="STYLE1">
<form method="get" onsubmit=""document.location ="c.asp?Page='+ this.page.value;return false;'">
<%if epage=1 then response.Write("首页")else response.Write("<a href='c.asp?page=1'>"&"首页"&"</a>")%>
<%if epage=1 then response.write("上一页")else response.write"<a href=c.asp?page="&epage-1&">上一页</a>"%>
<%if epage = rs.pagecount then response.write("下一页")else response.write"<a href=c.asp?page="&epage+1&">下一页</a>"%>
<%if epage = rs.pagecount then response.write("末页")else response.write"<a href=c.asp?page="&rs.pagecount&">末页</a>"%>
现在是第<font color="red"><%=epage%></font>页一共有<font color="red"><%=rs.pagecount%></font>页
<input name="page" value="<%=epage%>" maxlength=5 tyep=text />
页
<input type=submit value=GO style="font-size:12px;border:1px solid #CCCCCC;width:23px;" /></form>
</div>
<p> </p>
<p>
<%
name=request("name")
pass=request("pass")
if name<>"" and pass<>"" then
rs.Addnew
rs("name")=name
rs("pass")=pass
rs.update
rs.close
end if
%>
</p>
</p>
<form id="form1" name="form1" method="post" action="">
<p>
<input name="name" type="text" id="name" />
</p>
<p>
<input name="pass" type="text" id="pass" />
<input type="submit" name="Submit" value="提交" />
</p>
</form>
<p>
<table width="63%" border="0" cellpadding="0" cellspacing="1" bgcolor="#0000FF" style="border-collapse: collapse">
<%
set mrs=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("zheng.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql="select * from user"
mrs.open sql,conn,1,1
If mRs.bof and mRs.eof then
Response.Write"<span>没有任何记录</span>"
Response.End
Else
mRs.PageSize =6'每页记录条数
iCount=mRs.RecordCount '记录总数
iPageSize=mRs.PageSize
maxpage=mRs.PageCount
page=request("page")
If Not IsNumeric(page) or page="" then
page=1
Else
page=cint(page)
End If
If page<1 then
page=1
ElseIf page>maxpage then
page=maxpage
End If
mRs.AbsolutePage=Page
If page=maxpage then
x=iCount-(maxpage-1)*iPageSize
Else
x=iPageSize
End If
End If
for i=1 to mRs.pagesize
%>
<tr>
<td width="64%" bgcolor="#FFFFFF" class="STYLE1"><%=mrs("name")%></td>
<td width="36%" bgcolor="#FFFFFF" class="STYLE1"><%=mrs("pass")%></td>
</tr><%
mRs.movenext
If mRs.eof then exit for
next
mRs.close
Set mRs=nothing
%>
<tr>
<td colspan="2" bgcolor="#CCCCCC">
<span class="STYLE1">
<%
call PageControl(iCount,maxpage,page)
Sub PageControl(iCount,pagecount,page)
'生成上一页下一页链接
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table border='0' cellpadding='3' style='border-collapse: collapse' width='100%' align='center'>")
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><tr>")
Response.Write("<td align='center' bgcolor='#FFFFFF'>")
If page<=1 then
Response.Write ("首页 " )
Response.Write ("上一页 ")
Else
Response.Write("<a href=" & action & "?" & temp & "Page=1>首页</a> ")
Response.Write("<a href=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</a> ")
End If
If page>=pagecount then
Response.Write ("下一页 ")
Response.Write ("尾页 ")
Else
Response.Write("<a href=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</a> ")
Response.Write("<a href=" & action & "?" & temp & "Page=" & pagecount & ">尾页</a> ")
End If
Response.Write(" 页次:" & page & "/" & pageCount & " 页")
Response.Write(" 共有 " & iCount & " 条留言")
Response.Write(" 转到 " & "<input tyep=text name=page maxlength=5 value=" & page & " style='font-size: 12px;border: 1px solid #CCCCCC;width:23px;'>" & " 页 <input type=submit style=""font-size: 9pt"" value=GO style='font-size: 12px;border: 1px solid #CCCCCC;width:23px;'>")
Response.Write("</td></tr></form>")
Response.Write("</table>")
End Sub
%>
</span></td>
</tr>
</table>
<span class="STYLE1">
</p>
</form>
</body>
</html>
asp,分页
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?
更新日志
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]