www.gusucode.com > 共享世纪内容管理系统 2.1 build 080704 全站开源版 > admin/PicManage.asp
<%Admin="File"%> <!--#include file="check.asp"--> <% '强制性刷新随机验证码 '让随机验证码每次按IE的后退按钮时,返回登录页面的随即码都自动刷新, Response.expires=-1 Response.AddHeader"pragma","no-cache" Response.AddHeader"cache-control","no-store" %> <% Domain=Request.ServerVariables("SERVER_NAME") gFilePath=Request.ServerVariables("PATH_INFO") gFilePath=lcase(left(gFilePath,instrRev(gFilePath,"/"))) CountN=len(gFilePath) gFilePath=lcase(left(gFilePath,CountN-1)) gFilePath=lcase(left(gFilePath,instrRev(gFilePath,"/"))) AllPath=Domain&gfilepath Set MyFile=Server.CreateObject("Scripting.FileSystemObject") if request.form("result")="del" then Num=request.form("FileName").count for x=1 to Num if MyFile.FileExists(Server.Mappath("..")&"\UploadFile\"&request.form("FileName")(x)&"") then MyFile.DeleteFile(Server.Mappath("..")&"\UploadFile\"&request.form("FileName")(x)&"") end if next end if Page=request.querystring("page") if Page<=1 or Page="" then Page=1 PageSize=15 Domain=Request.ServerVariables("SERVER_NAME") gFilePath=Request.ServerVariables("PATH_INFO") gFilePath=lcase(left(gFilePath,instrRev(gFilePath,"/"))) CountN=len(gFilePath) gFilePath=lcase(left(gFilePath,CountN-1)) gFilePath=lcase(left(gFilePath,instrRev(gFilePath,"/"))) AllPath="http://"&Domain&gfilepath FileCount=0 Set FileFolder=MyFile.GetFolder(Server.MapPath("..")&"\UploadFile") for each TheFile in FileFolder.Files FileCount=FileCount+1 AFileSize=TheFile.size+AFileSize next %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>共享世纪新闻文章管理系统</title> <meta copy="WWW.2KY.CN 共享世纪"> <link rel="stylesheet" href="admin.css" type="text/css"> </head> <body> <form method=post action=""> <script language="javascript"> function CheckAll(form) { for (var i=0;i<form.elements.length;i++) { var e = form.elements[i]; if (e.name != 'chkall') e.checked = form.chkall.checked; } } function Isvalidity(val,name){ if (val.value!='' && (isNaN(val.value) || val.value<=0)) {alert(name+"应填有效数字!"); val.value=""; val.focus();} } </script> <table width="95%" border="0" cellspacing="1" cellpadding="3" align=center class="tableBorder"> <tr valign="middle" align="center"> <th height="2" colspan="3" background="images/BLogo.gif"> <b>图 片 管 理 器</b></th> </tr> <table width="95%" border="0" cellspacing="1" cellpadding="3" align=center class="tableBorder"> <tr> <td class=forumHeaderBackgroundAlternate height=20 width="48%" align=center onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor=''; colspan="2">文件名/路径</td> <td class=forumHeaderBackgroundAlternate height=20 width="20%" align=center onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor='';>上传时间</td> <td class=forumHeaderBackgroundAlternate height=20 width="14%" align=center onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor='';>文件大小</td> <td class=forumHeaderBackgroundAlternate height=20 width="13%" align=center onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor='';>删除</td> </tr> <% i=0 for each thing in FileFolder.Files i=i+1 if CCount>=PageSize then exit for elseif i>PageSize*(Page-1) then CCount=CCount+1 %> <tr> <td class=forumrow height=20 width="6%" onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor='';> <p align="center"><img border="0" src="<%=AllPath&"uploadfile/"&thing.name%>" width="40" height="40" OnClick="sendpic(this.src);"></td> <td class=forumrow height=20 width="51%" onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor='';><a href=../uploadfile/<%=thing.name%> OnClick="sendpic(this.src);"><%=AllPath&"uploadfile/"&thing.name%></a> </td> <td class=forumrow height=20 width="20%" align=center onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor='';><%=thing.DateLastModified%></td> <td class=forumrow height=20 width="9%" align=center onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor='';><%=thing.Size&"(字节)"%></td> <td class=forumrow height=20 width="10%" align=center onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor='';><input type="checkbox" name=FileName value=<%=thing.Name%>></td> </tr> <% end if next %> <tr> <td class=forumrow height=20 width="100%" colspan=5 align=right onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor='';> 共有<font color=red><b><%=FileCount%></b></font>个文件; 占用<font color=red><b><%=AFileSize/1024%></b></font><font color=#0000ff><b>K</b></font>空间 <input type=hidden value=del Name=result> <input type="checkbox" name="chkall" onclick="CheckAll(this.form)" value="ON">选中所有 <input type=submit value=删除 onclick="return Del()"> </td> </tr> <tr> <td class=forumHeaderBackgroundAlternate height=20 width="100%" colspan=5 onMouseOver=this.style.backgroundColor='#FAFBFC'; this.style.cursor='hand'; onMouseOut=this.style.backgroundColor='';> <% PageCount=int(FileCount/PageSize)+1 for i=1 to PageCount response.write "<a href=PicManage.asp?Page="&i&"><b> "&i&" </b></a>" next %> </td> </tr> </table> </td> </tr> </table> </form> </body> </html>