asp+fso在线管理图片功能

2018-09-06 10:33

阅读:615

  复制代码 代码如下:
<%
---------------------------------------------
##############20060528新增加了对端口的支持
作者:
功能完善
%>
<!--#includefile=global.asp-->
<!--#includefile=session.asp-->
<%
SetMyFile=Server.CreateObject(Scripting.FileSystemObject)
ifrequest.form(action)=delallthen
forx=1toNum
thedelall=Server.Mappath(../upload/&request.form(delFileName)(x))
ifmyfile.fileexists(thedelall)then
myfile.deletefile(thedelall)
endif
next
endif
page=cint(request.querystring(page))
ifPage<=1orPage=thenPage=1
PageSize=25
Domain=Request.ServerVariables(SERVER_NAME)
gFilePath=Request.ServerVariables(PATH_INFO)
serverport=request.ServerVariables(SERVER_PORT)
gFilePath=lcase(left(gFilePath,instrRev(gFilePath,/)))
CountN=len(gFilePath)
gFilePath=lcase(left(gFilePath,CountN-1))
gFilePath=lcase(left(gFilePath,instrRev(gFilePath,/)))
ifserverport<>80then
AllPath=
else
AllPath=
endif
filepath=../upload/
dimfso
setfso=server.CreateObject(scripting.filesystemobject)
setthefolder=fso.getfolder(server.MapPath(filepath))
foreachffilesinthefolder.files
filecounts=filecounts+1
filesizes=filesizes+ffiles.size
iffilesizes=0then
response.write此文件夹下没有内容
response.end
endif
next

%>
<!DOCTYPEhtmlPUBLIC-//W3C//DTDXHTML1.0Transitional//EN
<htmlxmlns=
<head>
<metahttp-equiv=Content-Typecontent=text/html;charset=gb2312/>
<title>dxy文件管理器</title>
<linkhref=main.cssrel=stylesheettype=text/css/>
<scriptlanguage=javascripttype=text/javascript>
functionCheckAll()
{
for(varic=0;ic<form1.delfilename.length;ic++)
{
vare=form1.delfilename[ic];
e.checked=!e.checked;
}
}
</script>
</head>

<bodystyle=margin:0px;>
<tablewidth=760border=0align=centercellpadding=3cellspacing=1bgcolor=#1F429E>
<formaction=method=postname=form1><tr>
<tdwidth=40height=25bgcolor=#FFFFFF><divalign=center>序号</div></td>
<tdwidth=493height=25bgcolor=#FFFFFF><divalign=center>文件名</div></td>
<tdwidth=100bgcolor=#FFFFFF><divalign=center>文件大小</div></td>
<tdwidth=98bgcolor=#FFFFFF><divalign=center>选择</div></td>
</tr>
<%
i=0
foreachffilesinthefolder.files
i=i+1
ifccount>=pagesizethen
exitfor
elseifi>pagesize*(page-1)then
ccount=ccount+1
%>
<tr>
<tdheight=25nowrap=nowrapbgcolor=#FFFFFFalign=center><%=i%></td>
<tdnowrap=nowrapbgcolor=#FFFFFF><divalign=center><%=ffiles.size%>[字节]</div></td>
<tdnowrap=nowrapbgcolor=#FFFFFF>
<divalign=center>
<inputname=delfilenametype=checkboxid=delfilenamevalue=<%=ffiles.name%>/>
</div></td></tr>
<%
endif
next
%>
<tr>
<tdheight=30colspan=4bgcolor=#FFFFFF><divalign=center>
共有文件<fontcolor=#FF0000style=font-family:Georgia,TimesNewRoman,Times,serif><%=filecounts%></font>个,占用空间<fontcolor=#FF0000style=font-family:Georgia,TimesNewRoman,Times,serif><%=formatnumber((filesizes/1024),2)%>k</font><br/>
<inputname=dxy_foldernametype=hiddenid=dxy_foldernamevalue=<%=request(dxy_foldername)%>/>
<inputtype=buttonname=Submit2value=全选/反选onclick=CheckAll()/>

<inputtype=submitname=Submitvalue=确定删除所选的文件/>
</p>
<inputname=actiontype=hiddenid=actionvalue=delall/>
</div></td>
</tr>
</form>
</table>
<tablewidth=760height=21border=0align=centercellpadding=0cellspacing=0>
<tr>
<tdbgcolor=#FFFFFF><divalign=center>
<%
iffilecountsmodpagesize=0then
pagecount=filecounts/pagesize
else
pagecount=filecounts/pagesize+1
endif
ifpage>pagecountthen
page=pagecount
else
page=page
endif
forii=1toPageCount
ifpage=iithen
response.write<ahref=picManage.asp?Page=&ii&>[<fontcolor=red>&ii&</font>]</a>
else
response.write<ahref=picManage.asp?Page=&ii&>[&ii&]</a>
endif
next
%>
</div></td>
</tr>
</table>
</body>
</html>


评论


亲,登录后才可以留言!