Picmanage.asp
上传用户:qyswxdl
上传日期:2013-06-01
资源大小:1373k
文件大小:5k
源码类别:

家庭/个人应用

开发平台:

ASP/ASPX

  1. <!--#include file="../checkpost.asp"-->
  2. <!--#include file="articleconn.asp" -->
  3. <!--#include file="security.asp"-->
  4. <%
  5.   Domain=Request.ServerVariables("SERVER_NAME")
  6.   soFilePath=Request.ServerVariables("PATH_INFO")
  7.   soFilePath=lcase(left(soFilePath,instrRev(soFilePath,"/")))
  8.   sowinpath=Domain&soFilePath
  9.   Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
  10.   if request.form("result")="del" then
  11.     Num=request.form("FileName").count
  12.     for x=1 to Num
  13.       if MyFile.FileExists(Server.Mappath("..")&"tupian"&request.form("FileName")(x)&"") then
  14.         MyFile.DeleteFile(Server.Mappath("..")&"tupian"&request.form("FileName")(x)&"")
  15.       end if
  16.     next
  17.   end if
  18.   Page=request.querystring("page")
  19.   if Page<=1 or Page="" then Page=1
  20.   PageSize=15
  21.   Domain=Request.ServerVariables("SERVER_NAME")
  22.   soFilePath=Request.ServerVariables("PATH_INFO")
  23.   soFilePath=lcase(left(soFilePath,instrRev(soFilePath,"/")))
  24.   socount=len(soFilePath)
  25.   soFilePath=lcase(left(soFilePath,socount-1))
  26.   soFilePath=lcase(left(soFilePath,instrRev(soFilePath,"/")))
  27.   sowinpath="http://"&Domain&soFilePath
  28.   FileCount=0
  29.   Set FileFolder=MyFile.GetFolder(Server.MapPath("..")&"tupian")
  30.   for each TheFile in FileFolder.Files
  31.     FileCount=FileCount+1
  32.     AFileSize=TheFile.size+AFileSize
  33.   next
  34. %>
  35. <LINK href="inc/Admin_STYLE.CSS" rel="stylesheet" type="text/css">
  36. <body bgcolor="#FFFFFF">
  37. <script language="JavaScript">
  38. function Del()
  39. {
  40. if(confirm("您确定要删除?nn DreamCtiy Theater System")
  41. )
  42. {return true;}
  43. return false;}
  44. function CheckAll(form)
  45. {
  46. for (var i=0;i<form.elements.length;i++)
  47. {
  48. var e = form.elements[i];
  49. if (e.name != 'chkall')
  50. e.checked = form.chkall.checked;
  51. }
  52. }
  53. </script>
  54. <form method=post action="">
  55.   <table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
  56.     <tr bgcolor="#FFFFFF" valign="middle" align="center"> 
  57.       <td width="300%" height="2" colspan="3" > <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#429AEF">
  58.           <tr bgcolor="#E1F4EE"> 
  59.             <td width="34%" height=20 align=center>文件名</td>
  60.             <td width="35%" height=20 align=center>上传时间</td>
  61.             <td width="20%" height=20 align=center>文件大小</td>
  62.             <td width="11%" height=20 align=center>删除</td>
  63.           </tr>
  64.           <%
  65.   i=0
  66.   for each thing in FileFolder.Files
  67.   i=i+1
  68.   if CCount>=PageSize then
  69.     exit for
  70.   elseif i>PageSize*(Page-1) then
  71.   CCount=CCount+1
  72. %>
  73.           <tr bgcolor="#E1F4EE"> 
  74.             <td width="34%" height=24 class="small1"> 
  75.               <div align="left"> 
  76.                 <table width="92%" border="0" align="center" cellpadding="0" cellspacing="0">
  77.                   <tr> 
  78.                     <td width="18%"><table width="30" height="30" border="0" cellpadding="0" cellspacing="1" bgcolor="#C9C9C9">
  79.                         <tr> 
  80.                           <td bgcolor="#FFFFFF"><a href="../tupian/<%=thing.name%>" target="_blank"><img src="../tupian/<%=thing.name%>" width="30" height="30" border="0"></a></td>
  81.                         </tr>
  82.                       </table></td>
  83.                     <td width="82%"><a href=../tupian/<%=thing.name%> target=_blank> 
  84.                       <%=thing.name%></a></td>
  85.                   </tr>
  86.                 </table>
  87.               </div></td>
  88.             <td width="35%" height=24 align=center><%=thing.DateLastModified%></td>
  89.             <td width="20%" height=24 align=center><%=thing.Size&"(bt)"%></td>
  90.             <td width="11%" height=24 align=center> 
  91.               <input type="checkbox" name=FileName value=<%=thing.Name%>></td>
  92.           </tr>
  93.           <%
  94.   end if
  95.   next
  96. %>
  97.           <tr bgcolor="#E1F4EE"> 
  98.             <td height=20 colspan=5 align=right> 
  99.               <div align="center">共有<font color=red><b><%=FileCount%></b></font>个文件; 
  100.                 占用<font color=red><b><%=AFileSize/1024%></b></font><font color=#FF0000><b>K</b></font>空间&nbsp;&nbsp;&nbsp;&nbsp; 
  101.                 <input type=hidden value=del Name=result>
  102.                 <input type="checkbox" name="chkall" onclick="CheckAll(this.form)">
  103.                 选中所有 
  104.                 <input type=submit value=删除 onclick="return Del()" class=Anbut1>
  105.               </div></td>
  106.           </tr>
  107.           <tr bgcolor="#E1F4EE"> 
  108.             <td height=20 colspan=5> 
  109.               <%
  110.   PageCount=int(FileCount/PageSize)+1
  111.   for i=1 to PageCount
  112.     response.write "<a href=?Page="&i&"><b>第"&i&"页</b></a> "
  113.   next
  114. %>
  115.             </td>
  116.           </tr>
  117.         </table></td>
  118.     </tr>
  119.   </table>
  120. </form>
  121. </body>
  122. </html>