if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
set rs=server.createobject("adodb.recordset")
sql="select * from [user] order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "暂时没有用户注册"
else
MaxPerPage=20
PageUrl="Userlist.asp"
totalPut=rs.recordcount
if currentpage if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
if (currentPage-1)*MaxPerPage rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
else
currentPage=1
showpage totalput,MaxPerPage,PageUrl
showContent
showpage totalput,MaxPerPage,PageUrl
end if
end if
end if
rs.close
sub showContent
i=0
%>
ID
用户名
email
修改
锁定
删除
do while not rs.eof
i=i+1
%>
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
end sub
function showpage(totalnumber,maxperpage,filename)
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
%>
共个用户
首页 上一页
 首页
上一页
end if
if n-currentpage %>
下一页 末页
下一页
末页
页次:/页
转到:
第页
set rs=nothing
conn.close
set conn=nothing%>