Fcontentsees.asp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <%Session.CodePage=65001%>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>网站后台管理登陆</title>
  6. <meta name="Keywords" content="网站后台管理系统,网站内容管理系统,asp网站后台管理系统,西安网站建设,西安网络公司" />
  7. <link rel="stylesheet" type="text/css" href="../bdcommx/css.css">
  8. </head>
  9. <body>
  10. <!--#include file="../bdcommx/connxyz.asp"-->
  11. <!--#include file="../bdcommx/jsall.asp"-->
  12. <%call log_chk()%>
  13. <%'---------------------------------删除文件
  14. If Request("act")="del" Then
  15. dname=request("dname")
  16. Fpath=request("Fpath")
  17. dname=Server.MapPath("../../"&Fpath&"/"&dname)
  18. Set fs = Server.CreateObject("Scripting.FileSystemObject")
  19. fs.deleteFile(dname)
  20. response.write"<SCRIPT language=JavaScript>alert('你已经删除了此文件');"
  21. response.write"this.location.href='Fcontentsees.asp?page="&request("page")&"&Fpath="&Fpath&"';</SCRIPT>"
  22. response.end
  23. Set fs = Nothing
  24. End if%>
  25. <table width="100%" height="42" border="0" cellpadding="0" cellspacing="0">
  26. <tr>
  27. <td width="4%" height="42" align="center" background="../images/top_bg2.jpg"><img src="../images/dian.gif" width="10" height="10" /></td>
  28. <td width="96%" background="../images/top_bg2.jpg" class="hui12">后台管理:&gt;&gt; 上传文件管理</td>
  29. </tr>
  30. </table><%
  31. Function ShowFileInfo(filespec)
  32. Dim fso,f
  33. Set fso = CreateObject("Scripting.FileSystemObject")
  34. Set f = fso.GetFile(filespec)
  35. ShowFileInfo = "Created:"& f.DateCreated
  36. End Function
  37. %>
  38. <%
  39. Function ShowFileInfo(filespec)
  40. Dim fso,f
  41. Set fso= CreateObject("Scripting.FileSystemObject")
  42. Set f= fso.GetFile(filespec)
  43. ShowFileInfo= "创建于:"&f.DateCreated
  44. End Function
  45. %>
  46. <table width="750" border="0" align="center" cellpadding="0" cellspacing="1" class="tab_bdr">
  47. <form id="form1" name="theForm" method="post" action="databack.asp?act=back">
  48. <tr>
  49. <td colspan="7" align="center" background="../images/bg2.jpg" class="tb_bg"><strong>已上传文件( <a href="Fmag.asp?Fpath=uploadfiles/title"><font color="#FF0000">缩略图管理</font></a> || <a href="Fcontent.asp?Fpath=fcheditor/attached/image"><font color="#FF0000">内容图片管理</font></a>)</strong></td>
  50. </tr>
  51. <tr>
  52. <td width="25%" height="26" align="center" class="NcB_bg">文件名</td>
  53. <td width="25%" align="center" class="NcB_bg">创建日期</td>
  54. <td width="25%" align="center" class="NcB_bg">大小</td>
  55. <td width="25%" align="center" class="NcB_bg">操作</td>
  56. </tr>
  57. <%
  58. dim count
  59. dim Fpath
  60. count = 0
  61. dname=request("dname")
  62. Fpath=request("Fpath")
  63. dname2=Server.MapPath("../../"&Fpath&"/"&dname)
  64. set objfilesys=server.CreateObject("Scripting.filesystemobject")
  65. set myfolder=objfilesys.getfolder(dname2)
  66. set myfiles=myfolder.files
  67. dim page,sPageSize,ecount,scount
  68. page = (Request.QueryString("page"))
  69. if page = "" or not IsNumeric(page) Then page = 1
  70. dim objfilesys
  71. dim myfolders
  72. dim myfile
  73. dim filecount, pagecount'准备分页
  74. sPageSize = 12'每页显示数
  75. filecount = clng(myfiles.count)
  76. pagecount = clng(filecount / sPageSize)
  77. if pagecount=0 then pagecount=1
  78. page = clng(page)
  79. scount = (page-1) * sPageSize + 1
  80. ecount = page * sPageSize
  81. %>
  82. <%
  83. for each myfile in myfiles
  84. fp = cstr(myfile.path)
  85. count = count +1
  86. if scount <= count and ecount >= count Then
  87. %>
  88. <tr>
  89. <td width="25%" height="26" align="center" class="NcB_bg"><%=myfile.name%></td>
  90. <td width="25%" align="center" class="NcB_bg"><%=myfile.DateCreated%></td>
  91. <td width="25%" align="center" class="NcB_bg"><%=clng(myfile.Size/1024)%> K</td>
  92. <td width="25%" align="center" class="NcB_bg"><a href="Fsee.asp?dname=<%=myfile.name%>&page=<%=page%>&Fpath=<%=Fpath%>">查看</a> || <a href="Fcontentsees.asp?dname=<%=myfile.name%>&act=del&page=<%=page%>&Fpath=<%=Fpath%>">删除</a></td>
  93. </tr>
  94. <%
  95. end if
  96. next
  97. %>
  98. <tr>
  99. <td height="26" colspan="4" align="center" class="NcB_bg">
  100. 共 <%=pagecount%> 页 <%=filecount%> 个文件 || 当前第:<%=page%> 页 ||
  101. <%
  102. for i=1 to pagecount
  103. %>
  104. <a href=?page=<%=i%>&Fpath=<%=Fpath%>><%if page=i then%><font color="#FF0000"><%=i%></font><%else%><%=i%><%end if%></a>
  105. <%next%></td>
  106. </tr> </form>
  107. </table>
  108. </body>
  109. </html>