ASP简易文件管理系统2.0
asp吧
全部回复
仅看楼主
level 1
suplchbaidu 楼主
<%@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 '''''' if request.querystring("filetype")="del" then fso.DeleteFile request.querystring("filename") end if if request.querystring("filetype")="cop" then session("filejt")=request.querystring("filename")session("cp")=true end if if request.querystring("filetype")="par" then session("filejt")=request.querystring("filename")session("cp")=false end if if request.querystring("cp")="ok" then if right(request.querystring("subf"),1)<>"\" then subf=request.querystring("subf")&"\"else subf=request.querystring("subf")end if if session("cp")=true then fso.CopyFile session("filejt"),subfelse fso.MoveFile session("filejt"),subfend ifsession("filejt")=""session("cp")="" 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("文件夹粘贴") elseif session("jtb")<>fso.getparentfoldername(request.querystring("subf")) and session("jtb")<>empty then response.Write("无法复制"&session("jtb")&"文件夹到当前文件夹")
2004年09月15日 11点09分 1
level 1
suplchbaidu 楼主
end if if session("filejt")<>"" and session("cp")<>"" then response.write("文件粘贴") 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 if if right(fol.path,1)<>"\" then filepath=fol.path&"\" else filepath=fol.path end iffor each fn in fol.filesresponse.write(fn.name&"   ")response.Write("删除 ")response.write("复制 ")response.write("剪贴
")next%> <%'listfd fol,""set fol=nothingset fso=nothingend if %>
2004年09月15日 11点09分 2
level 1
suplchbaidu 楼主
将其保存为listfile.asp
2004年09月15日 11点09分 3
level 1
suplchbaidu 楼主
http://post.baidu.com/f?kz=1808655
2004年09月15日 11点09分 4
1