📄 lister.asp
字号:
<!-- #include file="../../include/pop_setup.asp" -->
<!-- #include file="../../include/pop_function.asp" -->
<!-- #include file="../../include/db_function.asp" -->
<!-- #include file="../../include/authentication.asp" -->
<!-- #include file="../../include/upload_5xsoft.inc" -->
<!-- #include file="htmlarea_function.asp" -->
<%
set upload=new upload_5xsoft ''建立上传对象
REM 需要打开的文件夹名称
if request.ServerVariables("REQUEST_METHOD")="POST" then
strPath=upload.form("Path")
if strPath="" then
strAbsolutePath=server.mappath(EmployeeBaseRoot)
else
strAbsolutePath=server.mappath(EmployeeBaseRoot &"/"& strPath)
end if
REM 删除或创建文件夹
strMyAction=upload.form("MyAction")
strActionPathName=upload.form("ActionPathName")
strRenameFileName=upload.form("RenameFileName")
if lcase(strMyAction)=lcase("DeletePath") then
call DeletePath(strAbsolutePath & "\"& strActionPathName)
end if
if lcase(strMyAction)=lcase("DeleteFile") then
call DeleteFile(strAbsolutePath & "\"& strActionPathName)
end if
if lcase(strMyAction)=lcase("CreateFolder") then
call CreateFolder(strAbsolutePath & "\"& strActionPathName)
end if
if lcase(strMyAction)=lcase("UploadFile") then
call UploadFile(strAbsolutePath & "\"& strActionPathName,strRenameFileName)
end if
else
strPath=request("Path")
if strPath="" then
strAbsolutePath=server.mappath(EmployeeBaseRoot)
else
strAbsolutePath=server.mappath(EmployeeBaseRoot &"/"& strPath)
end if
end if
dim arrPaths,i,j,Indent
Indent=0 '缩进数目
Dim fs, f, f1, fc, s, schild,p,fsize
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(strAbsolutePath)
Set fc = f.SubFolders
%>
<html>
<head>
<title><%=htmlencode(DEF_SiteName)%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../../css/default.css" type="text/css">
<Script language="JavaScript">
<!--
function DeletePath_onclick(PathName){
if(!confirm("您确定要删除文件夹吗?"))return false;
document.all("MyAction").value="DeletePath";
document.all("ActionPathName").value=PathName;
document.all("btnSubmit").click();
return false;
}
function DeleteFile_onclick(PathName){
if(!confirm("您如果之前某些文章用到了此图片,删除图片则会使这些文章中的图片无法显示,您确定要删除文件吗?"))return false;
document.all("MyAction").value="DeleteFile";
document.all("ActionPathName").value=PathName;
document.all("btnSubmit").click();
return false;
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="lister.asp" enctype="multipart/form-data" >
<input type="hidden" name="MyAction" value="">
<input type="hidden" name="ActionPathName" value="">
<input type="hidden" name="Path" value="<%=htmlencode(strPath)%>">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td nowrap><a href="lister.asp"><img src="opened.gif" width="17" height="17" border="0" align="bottom"></a><a href="lister.asp">根文件夹</a></td>
<td align="right" nowrap> </td>
</tr>
<%
REM 列出当前路径的子目录
call DirTag(strPath)
dim objFolder
For Each f1 in fc
s = f1.name
if strPath<>"" then
strUrlPath=strPath &"/"& s
else
strUrlPath=s
end if
p = f1.DateLastModified
fsize = f1.Size
%>
<tr>
<td nowrap>
<%
for i=0 to Indent
response.write("<img src=""indent.gif"">")
next
response.write("<a href=""lister.asp?Path="& server.urlencode(strUrlPath) &""">")
response.write("<img src=""closed.gif"" align=""bottom"" border=""0"">")
response.write(s)
response.write("</a>")
REM 判断文件夹有无内容,无则显示删除
Set objFolder = fs.GetFolder(strAbsolutePath &"\"& f1.name)
%>
</td>
<td align="right" nowrap>
<%if objFolder.files.count=0 and objFolder.SubFolders.count=0 then%>
[<a href="#" onClick="JavaScript:return DeletePath_onclick('<%=FixJs(s)%>');">删除</a>]
<%end if%>
</td>
<%
Set objFolder=nothing
%>
</tr>
<%
next
REM 列出文件夹所有的文件
For Each f1 in f.Files
s = f1.name
ext=lcase(ExtractFileExt(s))
if ext="gif" or ext="jpg" or ext="png" then
if strPath<>"" then
strUrlPath=strPath &"/"& s
else
strUrlPath=s
end if
p = f1.DateLastModified
fsize = f1.Size
%>
<tr>
<td nowrap>
<%
for i=0 to Indent
response.write("<img src=""indent.gif"">")
next
response.write("<img src=""")
select case lcase(ext)
case "gif"
response.write("gif.gif")
case "jpg"
response.write("jpg.gif")
case "png"
response.write("png.gif")
end select
response.write(""" align=""bottom"">")
response.write("<a href=""viewer.asp?Path="& urlencode(strUrlPath) &""" target=""viewer"">")
response.write(s)
response.write("</a>")
%>
</td>
<td align="right" nowrap>[<a href="#" onClick="JavaScript:return DeleteFile_onclick('<%=FixJs(s)%>');">删除</a>]</td>
</tr>
<%
end if
next
%>
<%
set fc=nothing
set f=nothing
set fs=nothing
%>
</table>
<input type="submit" name="btnSubmit" value="Submit" style="display:none">
</form>
<script language="JavaScript">
parent.viewer.location.href="viewer.asp";
parent.document.all("txtFileName").value="http://";
</Script>
</body>
</html>
<%
set upload=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -