level 1
suplchbaidu
楼主
将如下代码保存为listfile.asp<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
无标题文档<% set fso=server.CreateObject("scripting.filesystemobject")if request.QueryString("type")="del" thenfso.deletefolder(request.QueryString("subf"))response.Redirect("listfile.asp?subf="&fso.getparentfoldername(request.QueryString("subf")))end ifif request.QueryString("type")="cop" thensession("jtb")=request.QueryString("subf")session("cz")="c"response.Redirect("listfile.asp?subf="&fso.getparentfoldername(request.QueryString("subf")))end ifif request.QueryString("type")="jt" thensession("jtb")=request.QueryString("subf")session("cz")="z"response.Redirect("listfile.asp?subf="&fso.getparentfoldername(request.QueryString("subf")))end if if request.QueryString("type")="zt" then if session("cz")="c" then fso.copyfolder session("jtb"),request.QueryString("subf")&"\" else fso.copyfolder session("jtb"),request.QueryString("subf")&"\" fso.deletefolder(session("jtb")) end if end if if request.QueryString("fdname")<>"" then if right(request.QueryString("subf"),1)<>"\" then fso.createfolder(request.QueryString("subf")&"\"&request.QueryString("fdname")) else fso.createfolder(request.QueryString("subf")&request.QueryString("fdname")) end if end if %> <% set dc=fso.Drivesfor each dri in dc response.Write(""&dri.path&" ")next %>
<% 'sub listfd(folderobject,str)'response.Write(str&"--"&folderobject.name&"
")'for each fd in folderobject.subfolders'listfd fd,str&" |"'next'end subif request.QueryString("subf")<>"" then set fol=fso.getfolder(request.QueryString("subf"))response.Write("当前位置:"&fol.path&" ") if session("jtb")<>"" and session("jtb")<>fso.getparentfoldername(request.QueryString("subf")) and session("jtb")<>request.QueryString("subf") then response.Write("粘贴") else response.Write("无法复制"&session("jtb")&"文件夹到当前文件夹") end if%>
>返回
新建文件夹
<% if request.QueryString("type")="new" then %> 请输入文件夹名称:
">
<% end if %>
<%if fol.subfolders.count>0 then response.write("
文件夹列表")else response.write("
无文件夹")end iffor each follist in fol.subfoldersresponse.Write("|--"&follist.name&"
")next%>
文件夹操作列表
<% for each follist in fol.subfolders response.Write(""&"删除"&" ") response.Write(""&"复制"&" ") response.Write(""&"剪贴"&"
") next %>
<%if fol.files.count>0 then response.Write("
文件列表:") else response.write("
无文件:") end iffor each fn in fol.filesresponse.write(fn.name&"
")next%> <%'listfd fol,""set fol=nothingset fso=nothingend if %>
2004年06月07日 07点06分
1
无标题文档<% set fso=server.CreateObject("scripting.filesystemobject")if request.QueryString("type")="del" thenfso.deletefolder(request.QueryString("subf"))response.Redirect("listfile.asp?subf="&fso.getparentfoldername(request.QueryString("subf")))end ifif request.QueryString("type")="cop" thensession("jtb")=request.QueryString("subf")session("cz")="c"response.Redirect("listfile.asp?subf="&fso.getparentfoldername(request.QueryString("subf")))end ifif request.QueryString("type")="jt" thensession("jtb")=request.QueryString("subf")session("cz")="z"response.Redirect("listfile.asp?subf="&fso.getparentfoldername(request.QueryString("subf")))end if if request.QueryString("type")="zt" then if session("cz")="c" then fso.copyfolder session("jtb"),request.QueryString("subf")&"\" else fso.copyfolder session("jtb"),request.QueryString("subf")&"\" fso.deletefolder(session("jtb")) end if end if if request.QueryString("fdname")<>"" then if right(request.QueryString("subf"),1)<>"\" then fso.createfolder(request.QueryString("subf")&"\"&request.QueryString("fdname")) else fso.createfolder(request.QueryString("subf")&request.QueryString("fdname")) end if end if %> <% set dc=fso.Drivesfor each dri in dc response.Write(""&dri.path&" ")next %>
<% 'sub listfd(folderobject,str)'response.Write(str&"--"&folderobject.name&"
")'for each fd in folderobject.subfolders'listfd fd,str&" |"'next'end subif request.QueryString("subf")<>"" then set fol=fso.getfolder(request.QueryString("subf"))response.Write("当前位置:"&fol.path&" ") if session("jtb")<>"" and session("jtb")<>fso.getparentfoldername(request.QueryString("subf")) and session("jtb")<>request.QueryString("subf") then response.Write("粘贴") else response.Write("无法复制"&session("jtb")&"文件夹到当前文件夹") end if%>
>返回
新建文件夹
<% if request.QueryString("type")="new" then %> 请输入文件夹名称:
">
<% end if %>
<%if fol.subfolders.count>0 then response.write("
文件夹列表")else response.write("
无文件夹")end iffor each follist in fol.subfoldersresponse.Write("|--"&follist.name&"
")next%>
文件夹操作列表
<% for each follist in fol.subfolders response.Write(""&"删除"&" ") response.Write(""&"复制"&" ") response.Write(""&"剪贴"&"
") next %>
<%if fol.files.count>0 then response.Write("
文件列表:") else response.write("
无文件:") end iffor each fn in fol.filesresponse.write(fn.name&"
")next%> <%'listfd fol,""set fol=nothingset fso=nothingend if %>