企業(yè)與個人網(wǎng)絡營銷一站式服務商
        網(wǎng)站建設 / SEO優(yōu)化排名 / 小程序開發(fā) / OA
        0731-88571521
        136-3748-2004
        asp 分頁函數(shù),可以顯示 1,2,3,4,5... 前十頁,后十頁,下一頁,上一頁
        信息來源:長沙網(wǎng)站建設優(yōu)化   發(fā)布時間:2011-8-1   瀏覽:
        asp 分頁函數(shù),可以顯示 1,2,3,4,5... 前十頁,后十頁,下一頁,上一頁
        方法一:
        <%  
           SoFia_DbName="jiaoyou" '修改此處為你的SQL   Server   數(shù)據(jù)庫名稱  
                   YourServer   =   "seven" '修改此處為你的Sql   Server數(shù)據(jù)庫地址  
                   YourUid     =   "sa" '修改此處為你的數(shù)據(jù)庫用戶名  
                   YourPassword   =   "struts" '修改此處為你的數(shù)據(jù)庫密碼            
                   Connstr   =   "Driver={SQL   Server};Server="&YourServer&";Uid="&YourUid&";Pwd="&YourPassword&";Database="&SoFia_DbName  
                   Set   Conn=Server.CreateObject("ADODB.CONNECTION")  
           '         On   Error   Resume   Next  
                   Conn.Open   Connstr  
                   If   Err<>0   Then  
                           err.Clear  
                           Set   Conn   =   Nothing  
                           Response.Write   "<div   align=center><br><br><br>連接SqlServer數(shù)據(jù)庫出錯,請檢查相關設置……</div>"  
                           Response.End          
                   End   If  
            
           set   rs   =   server.CreateObject("adodb.recordset")  
           rs.open   "select   *   from   userInfo   order   by   id   desc",conn,1,1  
           if   not(rs.Eof   and   rs.Bof)   Then  
           page   =   trim(request.form("page"))  
           if   page   =   ""   then   page   =   trim(request.QueryString("page"))  
           if   Not(IsNumeric(page))   or   page   =   "0"   then   page   =   1  
           rs.pageSize   =   30 '設置每頁的個數(shù)  
           strFile   =   "?" '設置當前頁面的名稱  
           pageCount   =   rs.pageCount  
           if   len(page)   >   4   then   page   =   pageCount  
           if   Cint(page)   >   Cint(pageCount)   then   page   =   pageCount  
           rs.absolutepage   =   page  
           for   i   =   1   to   rs.pagesize  
           if   rs.eof   then   exit   for  
           Response.Write   (Rs("username")&"<br>")&VbNewline  
           rs.MoveNext  
           Next'i  
           End   if%>  
            
           <%  
           Response.Write   ("<table   border=0   align=center   cellpadding=0   cellspacing=0><tr><td>")&VbNewline  
           if   pagecount   <   1   then   pagecount   =   1  
           response.Write   ("第"&page&"頁/共"&PAGECOUNT&"頁,每頁"&rs.pageSize&"條/共"&rs.recordCount&"條記錄</td><td> ")  
           beginpage   =   1  
           endpage   =   CInt(pagecount)  
           page   =   CInt(page)  
           if   pagecount   >=   9   then  
           if   page   >=   5   then  
           beginpage   =   page   -   4  
           if   page   <=   (pagecount   -   4)   then  
           endpage   =   page   +   4  
           else  
           endpage   =   pagecount  
           beginpage   =   pagecount   -   4  
           end   if  
           else  
           beginpage   =   1  
           endpage   =   9  
           end   if  
           end   if  
           if   beginpage>1   then   response.write   "<a   title=首頁   href='"&strFile&logpage&"'><font   face=webdings>9</font></a>"  
           for   j   =   beginpage   to   endpage  
           if   j   =   page   then  
           response.write"[<b>"&j&"</b>] "  
           else  
           response.write"[<a   href='"&strFile&"page="&j&logpage&"'>"&j&"</a>] "  
           end   if  
           next  
           if   endpage   <   pagecount   then   response.write   ("<a   title=末頁   href='"&strFile&"page="&pagecount&logpage&"'><font   face=webdings>:</font></a>")  
           Response.Write   ("</td><form   name='changepage'   method='post'   action='"&strFile&"'><td   align='right'> ")&VbNewline  
           Response.Write   ("<select   name='page'   onchange='document.changepage.submit();'>")&VbNewline  
           For   i=0   To   pagecount    
           If   i<>pagecount   Then    
           Response.Write   ("<option   value='"&i+1&"'")  
           If   page=i+1   Then   Response.Write   ("   selected")  
           Response.Write   (">"&i+1&"</option>")&VbNewline  
           End   If  
           Next  
           Response.Write   ("</select></td></form></tr></table>")  
           rs.close  
           set   rs   =   nothing  
           %>


        方法二:
        <!--#include   file="conn.asp"-->  
           <%  
           dim   ip  
           ip=Request.ServerVariables("REMOTE_ADDR")  
           %>  
           <html>  
            
           <head>  
           <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
           <link   href="css.css"   rel="stylesheet"   type="text/css">  
           <title>LCD軟件管理系統(tǒng)   全部軟件</title>  
           <script   language="JavaScript">  
           function   deletes()  
           {  
           if(   confirm("你確定要刪除這些文件嗎?\n"))  
           {return   true;  
           }  
             return   false;  
           }  
           </script>  
            
           </head>  
            
           <body   leftmargin="0"   topmargin=5>  
           <center>  
           <h3><font   color=red   face="幼圓">全部軟件列表</font></h3>  
            
           <%  
           set   rs=server.createobject("adodb.recordset")  
           sql="select   *   from   info   where   used=0   and   pn<>'0'   order   by   pn"  
           rs.open   sql,conn,1,1  
           %>  
           <table   width="870"   border="0"   cellpadding="0"   cellspacing="0"   style="border-collapse:   collapse"   bordercolor="#111111"   class=text>  
           <tr><td   colspan="6">  
           共有:<font   size=2   color=red><b> <%=rs.recordcount%> </b></font><font   size=2>個軟件</font>  
           <%    
           MMaxPerPage=15  
           rs.PageSize=MMaxPerPage    
           if   trim(request("Page"))<>""   then  
           CurrentPage=CInt(request("Page"))  
               if   CurrentPage>rs.PageCount   then  
           CurrentPage=rs.PageCount  
               end   if  
           else  
           CurrentPage=1  
           end   if  
            
            
           ttotalPut=rs.RecordCount  
               if   CurrentPage<>1   then  
           if   (CurrentPage-1)*MMaxPerPage<ttotalPut   then  
           rs.Move(CurrentPage-1)*MMaxPerPage  
                                           bookmark=rs.Bookmark  
           end   if  
               end   if      
            
            
            
           if   (ttotalPut   mod   MMaxPerPage)=0   then  
           mm=ttotalPut\MMaxPerPage                  
           else  
           mm=ttotalPut\MMaxPerPage+1  
           end   if  
            
            
           if   (ttotalPut   mod   (MMaxPerPage*10))=0   then  
           nn=ttotalPut\(MMaxPerPage*10)                      
           else  
           nn=ttotalPut\(MMaxPerPage*10)+1  
           end   if  
           %>  
            
            
                         <%  
                                   if   (CurrentPage   mod   10)=0   then  
                         kk=CurrentPage\10-1  
                   else    
                         kk=CurrentPage\10  
                                   end   if  
            
                                   if   nn>1   and   CurrentPage>10   then  
                         Response.Write   "<b><a   href='all.asp?s1="&request("s1")&"&s2="&request("s2")&"&s3="&request("s3")&"&s4="&request("s4")&"&andor="&request("andor")&"&ss="&request("ss")&"&page="+CStr((kk-1)*10+1)+"'>Pre.</a></b>"  
                   end   if  
            
            
                   for   ii=1   to   10  
           jj=kk*10+ii  
                     if   jj<=mm   then  
                           if   jj=CurrentPage   then  
                 Response.Write   "   <font   color=red>"+CStr(jj)+"</font>"  
                           else  
                 Response.Write   "   <b>"+"<a   href='all.asp?s1="&request("s1")&"&s2="&request("s2")&"&s3="&request("s3")&"&s4="&request("s4")&"&andor="&request("andor")&"&ss="&request("ss")&"&page="+CStr(jj)+"'>"+CStr(jj)+"</a></b>"  
                           end   if  
                     end   if  
                   next  
                    
                                   Response.Write   "   "  
                   if   kk<nn-1   then  
                         Response.Write   "   <b>"+"<a   href='all.asp?s1="&request("s1")&"&s2="&request("s2")&"&s3="&request("s3")&"&s4="&request("s4")&"&andor="&request("andor")&"&ss="&request("ss")&"&page="+CStr((kk+1)*10+1)+"'>Next</a></b>"  
            
                   end   if  
           %></td></tr></table>  
           <table   width="870"   border=0   cellpadding=0   cellspacing=0   class=text>  
           <tr>  
                                   <td   width=30>ID</td>  
           <td   width=110>料號</td>  
           <td   width=190>顯示屏</td>  
           <td   width=100>主板</td>  
           <td   width=180>語言</td>  
           <td   width=110>LOGO</td>  
           <td   width=50>版本</td>  
           <td   width=60>文件大小</td>  
           <td   width=40>   </td>  
           </tr>  
           <tr   height="1"   bgcolor="#689ACE"><td   colspan="9"></td></tr>  
            
           <%  
                               k=0  
                               for   y=(page-1)*15+1   to   (page-1)*15+15  
                               do   while   not   rs.EOF   and   i<MMaxPerPage  
            
           %>  
           <tr   <%if   i   mod   2   then%>   bgcolor=#DEE3F7   <%End   if%>   height=25>  
                   <td   width=30>  
           <%  
           Set   Fs   =   Server.CreateObject("Scripting.FileSystemObject")  
           If   Fs.FileExists(server.mappath("uploadfile/"&rs("filepath")))   Then  
           Response.Write   "<font   color=gray>"&rs("id")&"</font>"  
           else  
                                   Response.Write   "<font   color=red>"&rs("id")&"</font>"  
           end   if  
           %></td>  
           <td   width=110><%=rs("pn")%></td>  
           <%set   rs1=server.createobject("adodb.recordset")  
                                   sql1="select   *   from   item   where   id="&rs("panel")  
                                   rs1.open   sql1,conn,1,1%>  
           <td   width=190><%=rs1("item")%></td>  
           <%set   rs1=server.createobject("adodb.recordset")  
                                   sql1="select   *   from   item   where   id="&rs("mb")  
                                   rs1.open   sql1,conn,1,1%>  
           <td   width=100><%=rs1("item")%></td>  
           <%set   rs1=server.createobject("adodb.recordset")  
                                   sql1="select   *   from   item   where   id="&rs("lang")  
                                   rs1.open   sql1,conn,1,1%>  
           <td   width=180><%=rs1("item")%></td>  
           <td   width=110><%If   IsNumeric(Left(rs("logo"),8))   then%><img   src="LogoFile/<%=rs("logo")%>"   width=100   border=0   vspace="1"><%else%><%=rs("logo")%><%End   if%></td>  
           <td   width=50><%=rs("vers")%></td>  
           <td   width=60><%=Round(rs("filesize")/1024,2)%>   K</td>  
           <td   width=40><a   href=#   onclick=openwin('list.asp?id=<%=rs("id")%>')>詳細</a></td>  
           </tr>  
            
           <%  
           i=i+1  
           rs.MoveNext    
           loop  
           next  
           %>  
           <tr   height="1"   bgcolor="#689ACE"><td   colspan="9"></td></tr>  
           </table>  
            
           </body>  
            
           </html>



        上一條: 網(wǎng)站百度快照回檔問題的經(jīng)驗
        下一條: 做網(wǎng)站SEO如何打造企業(yè)品牌
        案例鑒賞
        多年的網(wǎng)站建設經(jīng)驗,斌網(wǎng)網(wǎng)絡不斷提升技術設計服務水平,迎合搜索引擎優(yōu)化規(guī)則
        做小程序開發(fā)
        多年的網(wǎng)站建設經(jīng)驗,網(wǎng)至普不斷提升技術設計服務水平,迎合搜索引擎優(yōu)化規(guī)則
        長沙私人做網(wǎng)站    長沙做網(wǎng)站    深圳網(wǎng)站建設    株洲做網(wǎng)站    東莞做網(wǎng)站    南京防腐木    湖南大拇指養(yǎng)豬設備    株洲做網(wǎng)站    
        版權所有 © 長沙市天心區(qū)斌網(wǎng)網(wǎng)絡技術服務部    湘公網(wǎng)安備 43010302000270號  統(tǒng)一社會信用代碼:92430103MA4LAMB24R  網(wǎng)站ICP備案號:湘ICP備13006070號-2  
        中文字幕欧美在线| 亚洲AV蜜桃永久无码精品| 中文字幕不卡亚洲| 午夜成人无码福利免费视频| 无码国产精品一区二区免费3p| 亚洲国产成人精品无码久久久久久综合| 久久久人妻精品无码一区| 精品无码人妻一区二区免费蜜桃| 中文字幕在线精品视频入口一区| 久久久久亚洲AV无码麻豆| 亚洲一级特黄大片无码毛片| 中文无码不卡的岛国片| 久久精品中文字幕久久| 久久国产三级无码一区二区| 日韩中文字幕在线观看| 国产色爽免费无码视频| 最近2019中文字幕大全第二页| 中文字幕亚洲乱码熟女一区二区| 西西午夜无码大胆啪啪国模| 日韩精品无码人妻一区二区三区| 日韩中文在线视频| 无码少妇一区二区三区| 一本一道AV无码中文字幕| 国产高清中文欧美| 久久水蜜桃亚洲av无码精品麻豆| 无码国产乱人伦偷精品视频| 久久亚洲AV成人无码| 无码GOGO大胆啪啪艺术| 亚洲第一极品精品无码久久| 无码中文字幕日韩专区视频| AV无码久久久久不卡蜜桃| 91无码人妻精品一区二区三区L| 最近中文国语字幕在线播放视频| 中文字幕无码av激情不卡久久| 亚洲av无码一区二区乱子伦as| 夜夜添无码一区二区三区| 亚欧无码精品无码有性视频| 日本成人中文字幕| 一本大道东京热无码一区| 欧美日韩中文国产一区| 在线免费中文字幕|