Fcontentsee.asp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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?pages="&request("pages")&"&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. Fpaths=Fpath&"/"&dname
  65. set objfilesys=server.CreateObject("Scripting.filesystemobject")
  66. set myfolder=objfilesys.getfolder(dname2)
  67. set myfiles=myfolder.files
  68. dim pages,sPageSize,ecount,scount
  69. pages = (Request.QueryString("pages"))
  70. if pages = "" or not IsNumeric(pages) Then pages = 1
  71. dim objfilesys
  72. dim myfolders
  73. dim myfile
  74. dim filecount, pagecount'准备分页
  75. sPageSize = 12'每页显示数
  76. filecount = clng(myfiles.count)
  77. pagecount = clng(filecount / sPageSize)
  78. if pagecount=0 then pagecount=1
  79. pages = clng(pages)
  80. scount = (pages-1) * sPageSize + 1
  81. ecount = pages * sPageSize
  82. %>
  83. <%
  84. for each myfile in myfiles
  85. fp = cstr(myfile.path)
  86. count = count +1
  87. if scount <= count and ecount >= count Then
  88. %>
  89. <tr>
  90. <td width="25%" height="26" align="center" class="NcB_bg"><%=myfile.name%></td>
  91. <td width="25%" align="center" class="NcB_bg"><%=myfile.DateCreated%></td>
  92. <td width="25%" align="center" class="NcB_bg"><%=clng(myfile.Size/1024)%> K</td>
  93. <td width="25%" align="center" class="NcB_bg"><a href="Fsee.asp?dname=<%=myfile.name%>&pages=<%=pages%>&Fpath=<%=Fpaths%>">查看</a> || <a href="Fcontentsee.asp?dname=<%=myfile.name%>&act=del&pages=<%=pages%>&Fpath=<%=Fpaths%>">删除</a></td>
  94. </tr>
  95. <%
  96. end if
  97. next
  98. %>
  99. <tr>
  100. <td height="26" colspan="4" align="center" class="NcB_bg">
  101. 共 <%=pagecount%> 页 <%=filecount%> 个文件 || 当前第:<%=pages%> 页 ||
  102. <%
  103. for i=1 to pagecount
  104. %>
  105. <a href=Fcontentsee.asp?pages=<%=i%>&Fpath=<%=Fpath%>&dname=<%=request("dname")%>><%if pages=i then%><font color="#FF0000"><%=i%></font><%else%><%=i%><%end if%></a>
  106. <%next%></td>
  107. </tr> </form>
  108. </table>
  109. </body>
  110. </html>