⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usermanage.asp

📁 这是一个文章管理的网页源程序
💻 ASP
字号:
<%@ Language=VBScript %>
<!--#include file="conn.asp"-->
<!--#include file="cheak.asp"-->

<%
	const MaxPerPage=20
	dim totalPut
	dim CurrentPage
	dim Totalpages
	dim i,j
	if not isEmpty(request("page")) then
		currentpage=cint(request("page"))
	else
		currentpage=1
	end if
%>
<html>
<head>
<title>120医学经典留言簿多用户版管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/new.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<p align="center">管理员:<%=session("admin")%> 嘿嘿!这可是秘密哟!</p>
<%dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * from admin order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
	response.write "目前还没有注册用户!"
else
	totalPut=rs.recordcount
	if currentpage<1 then
		currentpage=1
	end if
	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
		showcontent
		showpage totalPut,MaxPerPage,"usermanage.asp"
    else
		if (currentpage-1)*MaxPerPage<totalPut then
			rs.move (currentpage-1)*MaxPerPage
			dim bookmark
			bookmark=rs.bookmark
			showcontent
			showpage totalPut,MaxPerPage,"usermanage.asp"
		else
			currentPage=1
			showcontent
			showpage totalPut,MaxPerPage,"usermanage.asp"
		end if
	end if
	rs.close
end if
set rs=nothing
conn.close
set conn=nothing

sub showcontent
dim i
i=0
do while not(rs.eof)
if rs.eof then
response.write "rs为空!"
exit do
end if
%>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#333333">
  <tr>
    <td>
      <table width="100%" border="0"  cellspacing="1" cellpadding="2" >
        <tr align="center" bgcolor="#006699"> 
    <td ><b><font color="#FFFFFF">ID</font></b></td>
    <td ><b><font color="#FFFFFF">用户名</font></b></td>
    <td ><b><font color="#FFFFFF">密码</font></b></td>
    <td ><b><font color="#FFFFFF">邮箱</font></b></td>
    <td ><b><font color="#FFFFFF">加入时间</font></b></td>
    <td ><b><font color="#FFFFFF">文章数目</font></b></td>
    <td ><b><font color="#FFFFFF">删除</font></b></td>
  </tr>
  <%i=0
          do while not rs.eof%> 
  <tr align="center" bgcolor="#FFFFFF"> 
    <td ><%=rs("id")%></td>
    <td ><%=rs("username")%></td>
    <td><%=rs("password")%></td>
    <td ><a href="mailto:<%=rs("email")%>"><%=rs("email")%></a></td>
    <td ><%=rs("addtime")%></td>
    <td ><%=rs("wzs")%></td>
    <td ><a href="dele.asp?id=<%=rs("id")%>&num=<%=rs("username")%>">删除</a></td>
  </tr>
  <% i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	   loop
		  %> 
</table></td>
  </tr>
</table>

<%
i=i+1
if i>=MaxPerPage then
exit do
end if
rs.movenext
loop
end sub

function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
	n=totalnumber \ maxperpage
else
	n=totalnumber \ maxperpage + 1
end if
response.write "<form method=post action="&filename&">"
response.write "<p align='center'>分页 "
if currentpage<2 then
	response.write "首页 上一页"
else
	response.write "<a href="&filename&"?page=1>首页</a> "
	response.write "<a href="&filename&"?page="&currentpage-1&">上一页</a> "
end if
if n-currentpage<1 then
	response.write "下一页 尾页 "
else
	response.write "<a href="&filename&"?page="&currentpage+1&">下一页</a> "
	response.write "<a href="&filename&"?page="&n&">尾页</a> "
end if
response.write "页次:<strong><font color=red>"&currentpage&"</font>/"&n&"</strong>页 "
response.write "共<b>"&totalnumber&"</b>个用户 <b>"&MaxPerPage&"</b>个用户/页 "
response.write "转到:<input type='text' name='page' size=4 maxlength=10 value="&currentpage&" class=myin1>"
response.write "<input  border='0' src='../images/go1.gif' type='image' name='cmdok' align='absmiddle'></p></form>"
end function
%> 
<%
rs.close
set rs=nothing
conn.close
set conn=nothing%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -