DataManage.asp
资源名称:1.rar [点击查看]
上传用户:yrf020
上传日期:2007-07-24
资源大小:1287k
文件大小:21k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <% Option Explicit %>
  3. <HTML xmlns="http://www.w3.org/1999/xhtml">
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
  6. <META NAME="copyright" CONTENT="Copyright 2006-2008 - Hokilly.com-STUDIO" />
  7. <META NAME="Author" CONTENT="红金羚软件,www.hokilly.com" />
  8. <META NAME="Keywords" CONTENT="" />
  9. <META NAME="Description" CONTENT="" />
  10. <TITLE>数据库操作</TITLE>
  11. <link rel="stylesheet" href="Images/CssAdmin.css">
  12. <script language="javascript" src="../Script/Admin.js"></script>
  13. <style type="text/css">
  14. <!--
  15. .STYLE1 {font-size: medium;
  16. font-weight: bold;
  17. color: #ff0000;
  18. }
  19. -->
  20. </style>
  21. </HEAD>
  22. <!--#include file="../Include/Const.asp" -->
  23. <!--#include file="../Include/ConnSiteData.asp" -->
  24. <!--#include file="CheckAdmin.asp"-->
  25. <%
  26. Dim SERVER_NAME
  27. SERVER_NAME=trim(Request.ServerVariables("SERVER_NAME"))
  28. if  (SERVER_NAME= ""&chr(119)&chr(119)&chr(119)&chr(46)&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&"")or(SERVER_NAME=  ""&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&"")or(SERVER_NAME=  ""&chr(108)&chr(111)&chr(99)&chr(97)&chr(108)&chr(104)&chr(111)&chr(115)&chr(116)&"")or(SERVER_NAME=  ""&chr(49)&chr(50)&chr(55)&chr(46)&chr(48)&chr(46)&chr(48)&chr(46)&chr(49)&"") then
  29. if Instr(session("AdminPurview"),"|115,")=0 then 
  30.   response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
  31.   response.end
  32. end if
  33. '========判断是否具有管理权限
  34. %>
  35. <BODY>
  36. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
  37.   <tr>
  38.     <td height="24" nowrap><font color="#FFFFFF"><img src="Images/Explain.gif" width="18" height="18" border="0" align="absmiddle">&nbsp;<strong>数据库操作:系统数据备分,压缩,恢复,管理员登录日志</strong></font></td>
  39.   </tr>
  40.   <tr>
  41.     <td height="24" align="center" nowrap  bgcolor="#eafefe">
  42.     <a href="DataManage.asp" onClick='changeAdminFlag("数据库操作")'>栏目首页</a><font color="#0000FF">&nbsp;|&nbsp;</font>网站数据库:<a href="DataManage.asp?Action=DataBackup&Result=Site" onClick='changeAdminFlag("网站数据库备份")'>备份</a>&nbsp;&nbsp;<a href="DataManage.asp?Action=DataCompact&Result=Site" onClick='changeAdminFlag("网站压缩数据库")'>压缩</a>&nbsp;&nbsp;<a href="DataManage.asp?Action=DataResume&Result=Site" onClick='changeAdminFlag("网站恢复数据库")'>恢复</a><font color="#0000FF">&nbsp;|&nbsp;</font><a href="DataManage.asp?Action=DataLog" onClick='changeAdminFlag("管理员登录日志")'>管理员登录日志</a><font color="#0000FF">&nbsp;|&nbsp;</font>流量数据库:<a href="DataManage.asp?Action=DataBackup&Result=Stat" onClick='changeAdminFlag("流量数据库备份")'>备份</a>&nbsp;&nbsp;<a href="DataManage.asp?Action=DataCompact&Result=Stat" onClick='changeAdminFlag("流量压缩数据库")'>压缩</a>&nbsp;&nbsp;<a href="DataManage.asp?Action=DataResume&Result=Stat" onClick='changeAdminFlag("流量恢复数据库")'>恢复</a><font color="#0000FF">&nbsp;</font></td>    
  43.   </tr>
  44. </table>
  45. <br>
  46. <br>
  47. <p class="STYLE1">免费版不提供此功能!请联系Tel:13915064582
  48.   或者QQ:15916190 购买商业正式版!</p>
  49. <p>详情请见:<a href="http://www.hokilly.com" target="_blank">http://www.hokilly.com</a></p>
  50. <p>常州红金羚软件技术有限公司 </p>
  51. </body>
  52. </html> 
  53. <%
  54. else
  55. response.write "<meta http-equiv=refresh content=0;URL="&chr(104)&chr(116)&chr(116)&chr(112)&chr(58)&chr(47)&chr(47)&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&chr(47)&chr(114)&chr(101)&chr(103)&chr(46)&chr(97)&chr(115)&chr(112)&">"
  56. response.end%>
  57. <%end if%>
  58. <%
  59. sub DataManage()
  60.   Dim Action
  61.   Action=request.QueryString("Action")
  62.   Select Case Action
  63.     Case "DataBackup"
  64.   DataBackup
  65.     Case "DataCompact"
  66.   DataCompact
  67.     Case "DataResume"
  68.   DataResume
  69.     Case "DataLog"
  70.   DataLog
  71.     Case Else
  72.       DataMain
  73.   End Select
  74. end sub  
  75. %>
  76. <%
  77. function DataMain
  78.   response.write ("<table width='100%' border='0' cellpadding='3' cellspacing='1' bgcolor='#6ab6b6'><tr><td height='24' nowrap  bgcolor='#eafefe'>")
  79.   response.write ("操作说明:<br>  ·数据库操作步骤为[备份&nbsp;→&nbsp;压缩&nbsp;→&nbsp;恢复]<br>  ·操作前最好先[<font color='#330099'>备份</font>]数据库,正在使用中的数据库不能被压缩<BR>  ·恢复数据库时将会覆盖当前使用中的数据库<br>  ·管理员登录日志可做查看、删除")
  80.   response.write ("</td></tr></table>")
  81. end function
  82. function DataBackup()
  83.   dim From,Fso,Result
  84.   From=request.QueryString("From")
  85.   Result=request.QueryString("Result")
  86.   response.write ("<table width='100%' border='0' cellpadding='3' cellspacing='1' bgcolor='#6ab6b6'><tr><td height='24' nowrap  bgcolor='#eafefe' align='center'>")
  87.   response.write ("<table width='560' border='0' cellspacing='0' cellpadding='0'><tr><td height='16'></td></tr>")
  88.   response.write ("<tr><td height='20'>说明:修改数据库备份保存路径和文件名,请进入[系统设置→站点常量设置→数据库备份路径]</td></tr>")
  89.   if From="Confirm" then
  90.     set Fso=Server.CreateObject("Scripting.FileSystemObject")
  91. if Result="Site" then
  92.   Fso.CopyFile Server.MapPath(SiteDataPath),Server.MapPath(SiteDataBakPath)
  93.       response.write ("<tr><td height='20'>成功:你已经成功备份数据到&nbsp;<a href='"&SiteDataBakPath&"' target='_blank'><font color='#330099'>"&SiteDataBakPath&"</font></a>&nbsp;,注意及时删除不用的备份!</td></tr>")
  94. else
  95.   Fso.CopyFile Server.MapPath(StatDataPath),Server.MapPath(StatDataBakPath)
  96.       response.write ("<tr><td height='20'>成功:你已经成功备份数据到&nbsp;<a href='"&StatDataBakPath&"' target='_blank'><font color='#330099'>"&StatDataBakPath&"</font></a>&nbsp;,注意及时删除不用的备份!</td></tr>")
  97.     end if
  98.   response.write ("<tr><td height='20'>版本:数据库的时间版本为&nbsp;"& now() &"</td></tr>")
  99.     Set Fso=nothing
  100.   end if   
  101.   response.write ("<form id='DataBackupForm' name='DataBackupForm' method='post' action='DataManage.asp?From=Confirm&Action=DataBackup&Result="&Result&"'>")
  102.   if Result="Site" then
  103.     response.write ("<tr><td height='30'>来源:<input name='fromPath' readonly type='text' size='60' value='"&SiteDataPath&"' class='textfield'/></td></tr>")
  104.     response.write ("<tr><td height='30'>目标:<input name='toPath' readonly type='text' size='60' value='"&SiteDataBakPath&"' class='textfield' /></td></tr>")
  105.   else
  106.     response.write ("<tr><td height='30'>来源:<input name='fromPath' readonly type='text' size='60' value='"&StatDataPath&"' class='textfield'/></td></tr>")
  107.     response.write ("<tr><td height='30'>目标:<input name='toPath' readonly type='text' size='60' value='"&StatDataBakPath&"' class='textfield' /></td></tr>")
  108.   end if
  109.   response.write ("<tr><td height='30'><input type='submit' value='确定备份' class='button' /></td></tr>")
  110.   response.write ("</form>")  
  111.   response.write ("<tr><td height='16'></td></tr></table>")
  112.   response.write ("</td></tr></table>")
  113. end function
  114. function DataCompact()
  115.   dim From,Fso,Engine,SDBPath,Result
  116.   From=request.QueryString("From")
  117.   Result=request.QueryString("Result")
  118.   response.write ("<table width='100%' border='0' cellpadding='3' cellspacing='1' bgcolor='#6ab6b6'><tr><td height='24' nowrap  bgcolor='#eafefe' align='center'>")
  119.   response.write ("<table width='560' border='0' cellspacing='0' cellpadding='0'><tr><td height='16'></td></tr>")
  120.   response.write ("<tr><td height='20'>说明:压缩前最好先[<font color='#330099'>备份</font>]数据库,正在使用中的数据库不能被压缩</td></tr>")
  121.   if From="Confirm" then
  122.     if Result="Site" then
  123.       SDBPath = server.mappath(SiteDataBakPath)
  124. else
  125.       SDBPath = server.mappath(StatDataBakPath)
  126. end if
  127.     set Fso=Server.CreateObject("Scripting.FileSystemObject")
  128. if Fso.FileExists(SDBPath) then
  129.       Set Engine =Server.CreateObject("JRO.JetEngine")
  130.   if request("boolIs") = "97" then
  131.      Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath, _
  132.                         "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath & "_temp.mdb;" _
  133.                         & "Jet OLEDB:Engine Type=" & JET_3X
  134.   else 
  135.      Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath, _
  136.                         "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath & "_temp.mdb"
  137.       end if
  138.       Fso.CopyFile SDBPath & "_temp.mdb",SDBPath
  139.       Fso.DeleteFile(SDBPath & "_temp.mdb")
  140.       set Fso = nothing
  141.       set Engine = nothing
  142.       response.write ("<tr><td height='20'>成功:数据库&nbsp;<a href='"&SDBPath&"' target='_blank'><font color='#330099'>"&SiteDataBakPath&"</font></a>&nbsp;已经压缩成功!</td></tr>")
  143.   response.write ("<tr><td height='20'>版本:数据库的时间版本为&nbsp;"& now() &"</td></tr>")
  144.     else
  145.       response.write ("<tr><td height='20'>失败:数据库&nbsp;<a href='"&SDBPath&"' target='_blank'><font color='#330099'>"&SiteDataBakPath&"</font></a>&nbsp;压缩失败,请检查路径和数据库名是否存在!</td></tr>")
  146.     end if
  147.   end if
  148.   response.write ("<form id='DataCompactForm' name='DataCompactForm' method='post' action='DataManage.asp?From=Confirm&Action=DataCompact&Result="&Result&"'>")
  149.   if Result="Site" then
  150.     response.write ("<tr><td height='30'>目标:<input name='toPath' readonly type='text' size='60' value='"&SiteDataBakPath&"' class='textfield'/></td></tr>")
  151.   else
  152.     response.write ("<tr><td height='30'>目标:<input name='toPath' readonly type='text' size='60' value='"&StatDataBakPath&"' class='textfield'/></td></tr>")
  153.   end if
  154.   response.write ("<tr><td height='30'><input type='submit' value='确定压缩' class='button' /></td></tr>")
  155.   response.write ("</form>")  
  156.   response.write ("<tr><td height='16'></td></tr></table>")
  157.   response.write ("</td></tr></table>")
  158. end function
  159. function DataResume()
  160.   dim From,Fso,SDPath,SDBPath,Result
  161.   From=request.QueryString("From")
  162.   Result=request.QueryString("Result")
  163.   response.write ("<table width='100%' border='0' cellpadding='3' cellspacing='1' bgcolor='#6ab6b6'><tr><td height='24' nowrap  bgcolor='#eafefe' align='center'>")
  164.   response.write ("<table width='560' border='0' cellspacing='0' cellpadding='0'><tr><td height='16'></td></tr>")
  165.   response.write ("<tr><td height='20'>说明:修改备份、目标数据库的保存路径和文件名,请进入[系统设置→站点常量设置→数据库备份路径]</td></tr>")
  166.   if From="Confirm" then
  167.     if Result="Site" then
  168.   SDPath = server.mappath(SiteDataPath)
  169.       SDBPath = server.mappath(SiteDataBakPath)
  170. else
  171.   SDPath = server.mappath(StatDataPath)
  172.       SDBPath = server.mappath(StatDataBakPath)
  173. end if
  174.     set Fso=Server.CreateObject("Scripting.FileSystemObject")
  175.     if Fso.FileExists(SDBPath) then
  176.       Fso.CopyFile SDBPath,SDPath
  177.       Set Fso=nothing
  178.       response.write ("<tr><td height='20'>成功:你已经成功恢复数据库&nbsp;<font color='#330099'>"&SDPath&"</font>&nbsp;注意及时删除不用的备份!</td></tr>")
  179.   response.write ("<tr><td height='20'>版本:数据库的时间版本为&nbsp;"& now() &"</td></tr>")
  180.     else
  181.       response.write ("<tr><td height='20'>失败:数据库&nbsp;<a href='"&SDBPath&"' target='_blank'><font color='#330099'>"&SDBPath&"</font></a>&nbsp;压缩失败,请检查路径和数据库名是否存在!</td></tr>")
  182.     end if
  183.   end if     
  184.   response.write ("<form id='DataResumeForm' name='DataResumeForm' method='post' action='DataManage.asp?From=Confirm&Action=DataResume&Result="&Result&"'>")
  185.   if  Result="Site" then
  186.     response.write ("<tr><td height='30'>来源:<input name='fromPath' readonly type='text' size='60' value='"&SiteDataBakPath&"' class='textfield'/></td></tr>")
  187.     response.write ("<tr><td height='30'>目标:<input name='toPath' readonly type='text' size='60' value='"&SiteDataPath&"' class='textfield' /></td></tr>")
  188.   else
  189.     response.write ("<tr><td height='30'>来源:<input name='fromPath' readonly type='text' size='60' value='"&StatDataBakPath&"' class='textfield'/></td></tr>")
  190.     response.write ("<tr><td height='30'>目标:<input name='toPath' readonly type='text' size='60' value='"&StatDataPath&"' class='textfield' /></td></tr>")
  191.   end if
  192.   response.write ("<tr><td height='30'><input type='submit' value='确定恢复' class='button' /></td></tr>")
  193.   response.write ("</form>")  
  194.   response.write ("<tr><td height='16'></td></tr></table>")
  195.   response.write ("</td></tr></table>")
  196. end function
  197. function DataLog()
  198. %>
  199. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
  200.   <form action="DelContent.asp?Result=LoginLog" method="post" name="formDel" >
  201.     <tr>
  202.       <td width="60" height="24" nowrap bgcolor="#6FBFBF"><font color="#FFFFFF"><strong>ID</strong></font></td>
  203.       <td width="60" nowrap bgcolor="#6FBFBF"><font color="#FFFFFF"><strong>登录名</strong></font></td>
  204.       <td width="70" nowrap bgcolor="#6FBFBF"><font color="#FFFFFF"><strong>用户名</strong></font></td>
  205.       <td width="124" nowrap bgcolor="#6FBFBF"><font color="#FFFFFF"><strong><font color="#FFFFFF">登录IP</font></strong></font></td>
  206.       <td width="260" nowrap bgcolor="#6FBFBF"><strong><font color="#FFFFFF">登录时浏览器</font></strong></td>
  207.       <td width="124" nowrap bgcolor="#6FBFBF"><strong><font color="#FFFFFF"><strong>创建时间</strong></font></strong></td>
  208.       <td nowrap bgcolor="#6FBFBF"><strong><font color="#FFFFFF">操作</font></strong>
  209.       <input onClick="CheckAll(this.form)" name="buttonAllSelect" type="button" class="button"  id="submitAllSearch" value="全" style="HEIGHT: 18px;WIDTH: 16px;">
  210.       <input onClick="CheckOthers(this.form)" name="buttonOtherSelect" type="button" class="button"  id="submitOtherSelect" value="反" style="HEIGHT: 18px;WIDTH: 16px;">
  211.   </td>
  212.     </tr>
  213. <% AdminLoginLog() %>
  214.   </form>
  215. </table>
  216. <%
  217. end function
  218. %>
  219. <%
  220. '-----------------------------------------------------------
  221. function AdminLoginLog()
  222.   dim idCount'记录总数
  223.   dim pages'每页条数
  224.       pages=20
  225.   dim pagec'总页数
  226.   dim page'页码
  227.       page=clng(request("Page"))
  228.   dim pagenc '每页显示的分页页码数量=pagenc*2+1
  229.       pagenc=2
  230.   dim pagenmax '每页显示的分页的最大页码
  231.   dim pagenmin '每页显示的分页的最小页码
  232.   dim datafrom'数据表名
  233.       datafrom="CompanyCMS_AdminLog"
  234.   dim datawhere'数据条件
  235.       datawhere=""
  236.   dim sqlid'本页需要用到的id
  237.   dim Myself,PATH_INFO,QUERY_STRING'本页地址和参数
  238.       PATH_INFO = request.servervariables("PATH_INFO")
  239.   QUERY_STRING = request.ServerVariables("QUERY_STRING")'
  240.       if QUERY_STRING = "" then
  241.     Myself = PATH_INFO & "?"
  242.   else
  243.    if Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
  244.           Myself = PATH_INFO & "?" & QUERY_STRING & "&"
  245. else
  246.       Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
  247. end if
  248.   end if
  249.   dim taxis'排序的语句 asc, desc
  250.       taxis="order by id desc"
  251.   dim i'用于循环的整数
  252.   dim rs,sql'sql语句
  253.   '获取记录总数
  254.   sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  255.   set rs=server.createobject("adodb.recordset")
  256.   rs.open sql,conn,0,1
  257.   idCount=rs("idCount")
  258.   '获取记录总数
  259.   if(idcount>0) then'如果记录总数=0,则不处理
  260.     if(idcount mod pages=0)then'如果记录总数除以每页条数有余数,则=记录总数/每页条数+1
  261.   pagec=int(idcount/pages)'获取总页数
  262.     else
  263.       pagec=int(idcount/pages)+1'获取总页数
  264.     end if
  265. '获取本页需要用到的id============================================
  266.     '读取所有记录的id数值,因为只有id所以速度很快
  267.     sql="select id from ["& datafrom &"] " & datawhere & taxis
  268.     set rs=server.createobject("adodb.recordset")
  269.     rs.open sql,conn,1,1
  270.     rs.pagesize = pages '每页显示记录数
  271.     if page < 1 then page = 1
  272.     if page > pagec then page = pagec
  273.     if pagec > 0 then rs.absolutepage = page  
  274.     for i=1 to rs.pagesize
  275.   if rs.eof then exit for  
  276.   if(i=1)then
  277.     sqlid=rs("id")
  278.   else
  279.     sqlid=sqlid &","&rs("id")
  280.   end if
  281.   rs.movenext
  282.     next
  283.   '获取本页需要用到的id结束============================================
  284.   end if
  285. '-----------------------------------------------------------
  286. '-----------------------------------------------------------
  287.   if(idcount>0 and sqlid<>"") then'如果记录总数=0,则不处理
  288.     '用in刷选本页所语言的数据,仅读取本页所需的数据,所以速度快
  289.     sql="select [ID],[AdminName],[UserName],[LoginIP],[LoginSoft],[LoginTime] from ["& datafrom &"] where id in("& sqlid &") "&taxis
  290.     set rs=server.createobject("adodb.recordset")
  291.     rs.open sql,conn,0,1
  292.     while(not rs.eof)'填充数据到表格
  293.   Response.Write "<tr bgcolor='#eafefe' onMouseOver = ""this.style.backgroundColor = '#FFFFFF'"" onMouseOut = ""this.style.backgroundColor = ''"" style='cursor:hand'>" & vbCrLf
  294.       Response.Write "<td nowrap>"&rs("ID")&"</td>" & vbCrLf
  295.       Response.Write "<td nowrap>"&rs("AdminName")&"</td>" & vbCrLf
  296.       Response.Write "<td nowrap>"&rs("UserName")&"</td>" & vbCrLf
  297.       Response.Write "<td nowrap>"&rs("LoginIP")&"</td>" & vbCrLf
  298.   if len(rs("LoginSoft"))>40 then
  299.         Response.Write "<td nowrap title='浏览器:&#13;"&rs("LoginSoft")&"'>"&left(rs("LoginSoft"),40)&"...</td>" & vbCrLf
  300.       else
  301.         Response.Write "<td nowrap title='浏览器:&#13;"&rs("LoginSoft")&"'>"&rs("LoginSoft")&"</td>" & vbCrLf
  302.       end if 
  303.       Response.Write "<td nowrap>"&rs("LoginTime")&"</td>" & vbCrLf
  304.     Response.Write "<td nowrap><input name='selectID' type='checkbox' value='"&rs("ID")&"' style='HEIGHT: 13px;WIDTH: 13px;'></td>" & vbCrLf
  305.       Response.Write "</tr>" & vbCrLf
  306.   rs.movenext
  307.     wend
  308.     Response.Write "<tr>" & vbCrLf
  309.     Response.Write "<td colspan='6' nowrap  bgcolor='#eafefe'>&nbsp;</td>" & vbCrLf
  310.     Response.Write "<td nowrap  bgcolor='#eafefe'><input name='submitDelSelect' type='button' class='button'  id='submitDelSelect' value='删除所选'  onClick='ConfirmDel(""您真的要删除这些管理员登录日志吗?"");'></td>" & vbCrLf
  311.     Response.Write "</tr>" & vbCrLf
  312.   else
  313.     response.write ("<tr><td height='50' align='center' colspan='7' nowrap  bgcolor='#eafefe'>暂无管理员登录日志</td></tr>")
  314.   end if
  315. '-----------------------------------------------------------
  316. '-----------------------------------------------------------
  317.   Response.Write "<tr>" & vbCrLf
  318.   Response.Write "<td colspan='7' nowrap  bgcolor='#bbe5e5'>" & vbCrLf
  319.   Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
  320.   Response.Write "<tr>" & vbCrLf
  321.   Response.Write "<td>共计:<font color='#ff6600'>"&idcount&"</font>条记录&nbsp;页次:<font color='#ff6600'>"&page&"</font></strong>/"&pagec&"&nbsp;每页:<font color='#ff6600'>"&pages&"</font>条</td>" & vbCrLf
  322.   Response.Write "<td align='right'>" & vbCrLf
  323.   '设置分页页码开始===============================
  324.   pagenmin=page-pagenc '计算页码开始值
  325.   pagenmax=page+pagenc '计算页码结束值
  326.   if(pagenmin<1) then pagenmin=1 '如果页码开始值小于1则=1
  327.   if(page>1) then response.write ("<a href='"& myself &"Page=1'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>9</font></a>&nbsp;") '如果页码大于1则显示(第一页)
  328.   if(pagenmin>1) then response.write ("<a href='"& myself &"Page="& page-(pagenc*2+1) &"'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>7</font></a>&nbsp;") '如果页码开始值大于1则显示(更前)
  329.   if(pagenmax>pagec) then pagenmax=pagec '如果页码结束值大于总页数,则=总页数
  330.   for i = pagenmin to pagenmax'循环输出页码
  331. if(i=page) then
  332.   response.write ("&nbsp;<font color='#ff6600'>"& i &"</font>&nbsp;")
  333. else
  334.   response.write ("[<a href="& myself &"Page="& i &">"& i &"</a>]")
  335. end if
  336.   next
  337.   if(pagenmax<pagec) then response.write ("&nbsp;<a href='"& myself &"Page="& page+(pagenc*2+1) &"'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>8</font></a>&nbsp;") '如果页码结束值小于总页数则显示(更后)
  338.   if(page<pagec) then response.write ("<a href='"& myself &"Page="& pagec &"'><font style='FONT-SIZE: 14px; FONT-FAMILY: Webdings'>:</font></a>&nbsp;") '如果页码小于总页数则显示(最后页)
  339.   '设置分页页码结束===============================
  340.   Response.Write "跳到:第&nbsp;<input name='SkipPage' onKeyDown='if(event.keyCode==13)event.returnValue=false' onchange=""if(/D/.test(this.value)){alert('只能在跳转目标页框内输入整数!');this.value='"&Page&"';}"" style='HEIGHT: 18px;WIDTH: 40px;'  type='text' class='textfield' value='"&Page&"'>&nbsp;页" & vbCrLf
  341.   Response.Write "<input style='HEIGHT: 18px;WIDTH: 20px;' name='submitSkip' type='button' class='button' onClick='GoPage("""&Myself&""")' value='GO'>" & vbCrLf
  342.   Response.Write "</td>" & vbCrLf
  343.   Response.Write "</tr>" & vbCrLf
  344.   Response.Write "</table>" & vbCrLf
  345.   rs.close
  346.   set rs=nothing
  347.   Response.Write "</td>" & vbCrLf  
  348.   Response.Write "</tr>" & vbCrLf
  349. '-----------------------------------------------------------
  350. '-----------------------------------------------------------
  351. end function 
  352. %>