文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学的各位小编整理了ASP-asp+fso在线管理图片功能 原创的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
复制代码 代码如下:
<%
''---------------------------------------------
''##############20060528新增加了对端口的支持
''作者:dxy QQ:461478385 Email:douxy001@gmail.com
''功能完善
%>
<!--#include file="global.asp"-->
<!--#include file="session.asp"-->
<%
Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
if request.form("action")="delall" then
Num=request.form("delFileName").count
for x=1 to Num
thedelall=Server.Mappath("../upload/"&request.form("delFileName")(x))
if myfile.fileexists(thedelall) then
myfile.deletefile(thedelall)
end if
next
end if
page=cint(request.querystring("page"))
if Page<=1 or Page="" then Page=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,"/")))
if serverport<>"80" then
AllPath="http://"&Domain&":"&serverport&gfilepath
else
AllPath="http://"&Domain&gfilepath
end if
filepath="../upload/"
dim fso
set fso=server.CreateObject("scripting.filesystemobject")
set thefolder=fso.getfolder(server.MapPath(filepath))
for each ffiles in thefolder.files
filecounts=filecounts+1
filesizes=filesizes+ffiles.size
if filesizes=0 then
response.write "此文件夹下没有内容"
response.end
end if
next
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>dxy文件管理器</title>
<link href="main.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function CheckAll()
{
for (var ic=0;ic<form1.delfilename.length;ic++)
{
var e = form1.delfilename[ic];
e.checked = !e.checked;
}
}
</script>
</head>
<body style="margin:0px;">
<table width="760" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#1F429E">
<form action="" method="post" name="form1"><tr>
<td width="40" height="25" bgcolor="#FFFFFF"><div align="center">序号</div></td>
<td width="493" height="25" bgcolor="#FFFFFF"><div align="center">文件名</div></td>
<td width="100" bgcolor="#FFFFFF"><div align="center">文件大小</div></td>
<td width="98" bgcolor="#FFFFFF"><div align="center">选择</div></td>
</tr>
<%
i=0
for each ffiles in thefolder.files
i=i+1
if ccount>=pagesize then
exit for
elseif i>pagesize*(page-1) then
ccount=ccount+1
%>
<tr>
<td height="25" nowrap="nowrap" bgcolor="#FFFFFF" align="center"><%=i%></td&