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

📄 weblist.asp

📁 个人备忘系统一个不错的备忘软件.专供刚学ASP的人学习. 代码简单易懂 mymanage
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
if session("user")="" or session("group")="" then
response.write("<script>alert('您还没有登陆或登陆超时');window.location.href('index.asp')</script>")
response.end
end if
%>
<%
dim page '定义页码变量
page=Request.QueryString("page") '获取地址栏页码
page=cint(page)
            if page<1 then 
              page=1
            end if
%>
<%
dim typ
typ=request.QueryString("id")
          if typ="" then
               response.write("<script>alert('非法提交参数!');window.location.href('addserver.asp')</script>")
               response.end
          end if
set rs1=server.CreateObject("adodb.recordset")
cmd1="select * from question where type='"&typ&"'"

rs1.open cmd1,conn,1,3
     if rs1.eof then
         response.write("<script>alert('无此类文章!');window.location.href('addserver.asp')</script>")
         response.end
      else
        Rs1.pagesize=8 '一页显示的记录数
        dim intReCun,intPaCun
          intReCun=rs1.Recordcount '总记录数
        intPaCun=rs1.pagecount '总页数
               if page>intPaCun then  page=intPaCun '当前页码于总页数比较
                  rs1.absolutepage=page
               end if


%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
<style type="text/css"> 
<!-- 
A { text-decoration: none} 
--> 
</style>

<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-size: 12px;
}
.style2 {
	font-size: 12px;
	color: #6699CC;
}
-->
</style>
</head>

<body>
<form name="form1" method="post" action="">
  <table width="700" border="0" align="center" bgcolor="#6699cc">
    <tr>
      <td colspan="5"><span class="style1">〓
        <%
select case typ
case 1
response.write "WEB服务器"
case 2
response.write  "FTP服务器"
case  3
response.write "Mail服务器"
case 4
response.write  "SQLSERVER服务器"
case 5
response.write "重要事情及密码"
case 6
response.write  "编程文章区"
case 7
response.write  "编程源码区"
case 8
response.write  "网络设备区"
case 9
response.write  "网络问题区"
case 10
response.write  "综合布线区"
end select
%>
      </span></td>
    </tr>
	<%
          dim i
          i=1
	do while not rs1.eof and i<9 '此时的20为是一页显示的记录数objRs.pagesize'while not rs1.eof
	%>
    <tr bgcolor="#FFFFFF">
      <td width="35"><div align="center" class="style2">
        <%=rs1("id") %>
      </div></td>
      <td width="491"><div align="left" class="style2"><% =rs1("title") %></div></td>
      <td width="47"><a href="editserver.asp?typ=<%=rs1("id")%>"><img src="images/edit.gif" width="47" height="18" border="0"></a></td>
      <td width="52"><a href="delserver.asp?typ=<%=rs1("id")%>"><img src="images/a_delete.gif" width="52" height="16" border="0"></a></td>
      <td width="53"><a href="showserver.asp?typ=<%=rs1("id")%>"><img src="images/voteView.gif" width="52" height="18" border="0"></a></td>
    </tr>
	<%
	i=i+1
rs1.movenext '下移一位
loop
	%>
  </table>
  <table width="700" border="0" align="center">
    <tr>
      <td height="18" align="center"><a href="weblist.asp?id=<%=typ%>" class="style2">第一页</a></span>
          <a href="weblist.asp?page=<%=page-1%>&id=<%=typ%>" class="style2">上一页</a>&nbsp;<a href="weblist.asp?page=<%=page+1%>&id=<%=typ%>" class="style2">下一页</a> <a href="weblist.asp?page=<%=intPaCun%>&id=<%=typ%>" class="style2">最后一页</a> <span class="style2">共有
          <% =intReCun%>
          条记录,分为<%=intPaCun %>页
      </span></span></td>
    </tr>
  </table>
  <p>&nbsp;</p>
</form>
<%
rs1.close
conn.close
set rs1=nothing
set conn=nothing
%>
</body>
</html>

⌨️ 快捷键说明

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