类似于iis浏览的功能

80酷酷网    80kuku.com

  iis<!---将此文件存为folder_list.asp看看效果就知道了加上权限就可以方便自己了,--->
<%
'const_domain_name为域名最后不要加斜杠
const const_domain_name="http://localhost"
%>
<style>
b,img,a{font-size:9pt;line-height:150%;text-decoration:none;color:#0000cc;}
span{font-size:12pt;}
</style>

<%
'------------------------------------------------显示当前目录下的子目录和文件
sub list
    Dim fso, f, f1, fc, s
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFolder(server.MapPath("."))
    set fs=f.SubFolders
    Set fc =f.Files
  
   For Each fss in fs
   dim folder_name
   folder_name=fss.name
%>
<a href="folder_list.asp?act=list_cur&cur_path=<%=fss%>"><span Each f1 in fc
    dim filename
    filename=f1.name
%>
<a href="<%=p2v_path(f1)%>"><span 2">/</span><%=filename%></a>

<%    
    Next
    
    set fso=nothing
end sub
%>


<%
'------------------------------------------------显示指定路径下的目录和文件
sub list_cur
    Dim fso, f, f1, fc, s
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFolder(request("cur_path"))
    set fs=f.SubFolders
    Set fc =f.Files
  
   For Each fss in fs
  dim folder_name
  folder_name=fss.name
%>
<a href="folder_list.asp?act=list_cur&cur_path=<%=fss%>"><span Each f1 in fc
    dim filename
    filename=f1.name
%>
<a href="<%=p2v_path(f1)%>"><span 2">/</span><%=filename%></a>

<%    
    Next
    set fso=nothing
end sub
%>





<%
'------------------------------------------------显示上级目录的子目录和子文件
sub list_parent
    on error resume next
     Dim fso, f, f1, fc, s
     Set fso = CreateObject("Scripting.FileSystemObject")
     Set f = fso.GetFolder(display_cur_path)
        set fs=f.SubFolders
     Set fc =f.Files
  
    For Each fss in fs
    dim folder_name
    folder_name=fss.name

%>
<a href="folder_list.asp?act=list_cur&cur_path=<%=fss%>"><span Each f1 in fc
    dim filename
    filename=f1.name
%>
<a href="<%=p2v_path(f1)%>"><span 2">/</span><%=filename%></a>

<%    
    Next
    set fso=nothing
   on error goto 0
end sub

'---------------------------------------------得到上级目录的路径
function get_parent_folder()
on error resume next
  &nbs

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: