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

📄 index.asp

📁 代码名称: 程式下载管理 添加日期: 2000-8-23 所属分类: ASP代码>主页管理 总下载次数: 697 文件大小: 20KB 适用环境: Unix/WINNT 评定级别:
💻 ASP
字号:
<!--#include file="dbconn.asp"-->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>程式下载</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<link rel="stylesheet" type="text/css" href="download.css">
</head>
<%
   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
   
%>

<body>
<div align="center"><center>

<table border="0" cellspacing="1" width="95%">
  <tr>
    <td>&nbsp; &gt;&gt; 当前位置 &gt; <a href="../index.htm" target="_top">首页</a> &gt; 
    程式下载</td>
  </tr>
</table>
</center></div><div align="center"><center>

<table border="0" cellspacing="1" width="95%" bgcolor="#F7FBFF">
  <tr>
    <td width="100%" bgcolor="#ACD6FF" height="20"><p align="center"><font color="#000000"><strong>程式下载 
    列表</strong></font></td>
  </tr>
  <tr>
    <td width="100%"><br>
<%
dim sql
dim rs
sql="select * from download order by id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
  if rs.eof and rs.bof then
       response.write "<p align='center'> 还 没 有 任 何 程 序</p>"
   else
	  totalPut=rs.recordcount
      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
           showpage totalput,MaxPerPage,"index.asp"
            showContent
            showpage totalput,MaxPerPage,"index.asp"
       else
          if (currentPage-1)*MaxPerPage<totalPut then
            rs.move  (currentPage-1)*MaxPerPage
            dim bookmark
            bookmark=rs.bookmark
           showpage totalput,MaxPerPage,"index.asp"
            showContent
             showpage totalput,MaxPerPage,"index.asp"
        else
	        currentPage=1
           showpage totalput,MaxPerPage,"index.asp"
           showContent
           showpage totalput,MaxPerPage,"index.asp"
	      end if
	   end if
   rs.close
   end if
	        
   set rs=nothing  
   conn.close
   set conn=nothing
  

   sub showContent
       dim i
	   i=0
  
%>    <div align="center"><center><table border="1" cellspacing="0" width="90%"
    bgcolor="#F0F8FF" bordercolorlight="#4DA6FF" bordercolordark="#ECF5FF">
      <tr>
        <td width="7%" align="center" bgcolor="#0080C0" height="20"><font color="#FFFFFF"><strong>ID号</strong></font></td>
        <td width="21%" align="center" bgcolor="#0080C0"><strong><font color="#FFFFFF">程式名称</font></strong></td>
        <td width="65%" align="center" bgcolor="#0080C0"><font color="#FFFFFF"><strong>程式简介</strong></font></td>
        <td width="7%" align="center" bgcolor="#0080C0"><font color="#FFFFFF"><strong>点击</strong></font></td>
      </tr>
<%do while not rs.eof%>
      <tr>
        <td height="23"><p align="center"><%=rs("id")%></td>
        <td><a href="openfile.asp?id=<%=rs("id")%>&amp;filename=<%=rs("filename")%>"><%=rs("showname")%></a></td>
        <td><%=rs("note")%>
</td>
        <td><p align="center"><%=rs("hits")%></td>
      </tr>
<% i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	   loop
		  %>
    </table>
    </center></div><%
   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'>&gt;&gt;分页&nbsp;"
  if CurrentPage<2 then
    response.write "<font color='999966'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?page=1>首页</a>&nbsp;"
    response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font color='999966'>下一页 尾页</font>"
  else
    response.write "<a href="&filename&"?page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
  end if
   response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
    response.write "&nbsp;共<b>"&totalnumber&"</b>个程式 <b>"&maxperpage&"</b>个程式/页 "
   response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=smallInput value="&currentpage&">"
   response.write "<input class=buttonface type='submit'  value=' Goto '  name='cndok'></span></p></form>"
       
end function

 
%>
<p> </td>
  </tr>
</table>
</center></div>
</body>
</html>

⌨️ 快捷键说明

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