正在阅读:FSO操作示例(给初学者)FSO操作示例(给初学者)

2004-06-04 10:29 出处:CSDN 作者:iuhxq 责任编辑:linjixiong


 saveupload()
case "delfolder"
 delfolder()
case "savefolder"
 savefolder()
case "editfolder"
 editfolder()
case "newfolder"
 newfolder()
case else
 foldername=request.QueryString("foldername")
 filename=request.QueryString("filename")
 path=foldername
 if path="" then path=server.MapPath("./")
 ShowFolderList(path)
end select

Function ShowFolderList(folderspec)
temp=request.ServerVariables("HTTP_REFERER")
temp=left(temp,Instrrev(temp,"/"))
temp1=len(folderspec)-len(server.MapPath("./"))-1
if temp1>0 then
 temp1=right(folderspec,cint(temp1))
elseif temp1=-1 then
 temp1=""
end if
tempurl=temp+replace(temp1,"\","/")+"/"
Set fso = CreateObject("Scripting.FileSystemObject")
upfolderspec=fso.GetParentfoldername(folderspec&"\")
%>
<a href="<%= url%>?action=newfolder&foldername=<%= folderspec%>">新建文件夹</a> | <a href="<%= url%>?action=newfile&filename=<%= folderspec&"\"%>">新建文件</a> | <a href="<%= url%>?action=upload">上传文件</a> | <a href="<%= url%>?foldername=<%= upfolderspec%>">向上</a> | <a href="file.asp">返回首页</a> | <a href="<%= url%>?action=logout">退出</a>
<table width="100%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#6595D6">
  <tr bgcolor="#E4E8EF">
    <td width="64%"><div align="center">名称</div></td>
    <td width="7%"><div align="right">大小</div></td>
    <td width="6%"><div align="center">类型</div></td>
    <td width="15%"><div align="left">修改时间</div></td>
    <td width="8%"><div align="center">操作</div></td>
  </tr>
<%
'列出目录
Set f = fso.GetFolder(folderspec)
Set fc = f.SubFolders
For Each f1 in fc





察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:

键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品