1NetMedia_Blog

<< FSO重命名文件和移动文件  类别: ASP/.NET Flash外部swf文件载入 >>
FSO替归历遍列出目录列表
[ 日期: 2006-09-22 8:42:25 AM | 作者: admin | 来源: 本站 | 人气:39256 | 晴天 | 心情: +2 ] 字号: 【
急速栏目链接:
标签:
<%
''替归历遍列出目录列表
''参数:path 文件路径
dim m
m=0
Sub ShowFolderTree(path)
  dim s,i,sp,nowpath
  m=m+1
  Set oFSO = Server.createObject("Scripting.FileSystemObject")
  Set oFolder = oFSO.GetFolder(Server.MapPath(path))
  Dim oSubFolder,oSubFolderNamme
  For Each oSubFolder In oFolder.SubFolders
    for n=1 to m
    oSubFolderNamme=oSubFolder.Name
      nowpath = path&oSubFolderNamme
      if right(nowpath,1)<>"/" then nowpath = nowpath&"/"
      if n = m and m = 1 then
      response.Write("<option value='"&nowpath&"'>"&trim(oSubFolderNamme)&"</option>")
      elseif n = m then
        sp=""
        For i=2 to n
          sp=sp&"&nbsp;&nbsp;&nbsp;"
        Next
      response.Write("<option value='"&nowpath&"'>"&sp&"├&nbsp;"&trim(oSubFolderNamme)&"</option>")
      end if
next
     Call ShowFolderTree(nowpath)
m=m-1
  Next
  set oFolder = nothing
  set oFSO = nothing
end sub
%><%
response.Write("<select name='MyFolderNamme' id='MyFolderNamme' style=""width:360px; height:15px;"" onchange=""jumpMenu('filelist',this,0)"" >")
response.Write "<option value=""UploadFiles/"">请选择文件夹[根]</option>"
  ShowFolderTree("UploadFiles/")
response.Write("</select>")
%>
   
Rss Comment  

没有相关评论

发表评论
请先注册,才能发表评论!
- 注册 -