- <!---将此文件存为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 style="font-family:wingdings">0</span><%=folder_name%></a><br>
- <%
- Next
- %>
- <%
- For Each f1 in fc
- dim filename
- filename=f1.name
- %>
- <a href="<%=p2v_path(f1)%>"><span style="font-family:wingdings 2">/</span><%=filename%></a><br>
- <%
- 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 style="font-family:wingdings">0</span><%=folder_name%></a><br>
- <%
- Next
- %>
- <%
- For Each f1 in fc
- dim filename
- filename=f1.name
- %>
- <a href="<%=p2v_path(f1)%>"><span style="font-family:wingdings 2">/</span><%=filename%></a><br>
- <%
- 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 style="font-family:wingdings">0</span><%=folder_name%></a><br>
- <%
- Next
- %>
- <%
- For Each f1 in fc
- dim filename
- filename=f1.name
- %>
- <a href="<%=p2v_path(f1)%>"><span style="font-family:wingdings 2">/</span><%=filename%></a><br>
- <%
- Next
- set fso=nothing
- on error goto 0
- end sub
- '---------------------------------------------得到上级目录的路径
- function get_parent_folder()
- on error resume next
- str=display_cur_path
- str_find="\"
- str_int=InStrRev (str,str_find)-1 '得到上一级目录的路径
- get_parent_folder=mid(str,1,str_int)
- err.clear
- end function
- '-----------------------------------------------将文件路径转为www发布的路径这样就可以下载了
- function p2v_path(p_path)
- 'p_path为硬盘上的物理路径
- dim host
- host=lcase(server.MapPath("\"))
- p_path=lcase(p_path)
- p2v_path=replace(p_path,host,const_domain_name)
- end function
- '-----------------------------------------------显示当前所在的路径
- function display_cur_path()
- cur_path=request("cur_path")
- if cur_path="" then
- display_cur_path=server.MapPath(".")
- else
- display_cur_path=cur_path
- end if
- set fso=nothing
- end function
- sub main
- %>
- <a href="folder_list.asp?act=list_parent&cur_path=<%=get_parent_folder%>">向上</a> <b><a href="javascript:void(null)"><%=display_cur_path%></a></B><p>
- <%
- select case request("act")
- case "list_parent"
- list_parent
- case "list_cur"
- list_cur
- case else
- list
- end select
- end sub
- main
- %>
类似于iis浏览的功能
2019-11-01 12:44asp教程网 ASP教程
类似于iis浏览的功能,将此文件存为folder_list.asp看看效果就知道了加上权限就可以方便自己了
延伸 · 阅读
- 2022-03-02windows server 2019开启iis服务器+tp5.1的完美配置运行
- 2022-02-21C#部署数据库及IIS站点
- 2022-02-20Windows Server 2012 安装配置IIS图文教程
- 2022-02-13Windows Sever IIS定时重启工具 v1.0绿色版
- 2022-01-04IIS下调用证书出现异常的解决方法 (C#)
- 2021-12-16iis与apache共用80端口配置方法
精彩推荐
- ASP教程
asp 采集实战代码
最近实在是太流行采集了,本人是不喜欢采集的,但对采集的原理我却很有兴趣进行研究,拿到了网上采集常用函数,对其进行了一番研究,并实战,结果...
- ASP教程
ASP常用函数:getpy()
ASP常用函数:getpy()...
- ASP教程
JScript中遍历Request表单参数集合的方法
这篇文章主要介绍了JScript中遍历Request表单参数集合的方法,本文以遍历Request.QueryString集合为例给出了实现代码,需要的朋友可以参考下...
- ASP教程
asp之基于adodb.stream的文件操作类
asp之基于adodb.stream的文件操作类...
- ASP教程
asp+javascript实现404页的处理转换
asp+javascript实现404页的处理转换...
- ASP教程
ASP.NET 数据源
数据源 一个 data sourse 控件与数据绑定的控件相互作用,并隐藏了复杂的数据的联编过程。这些是提供数据给 data bound 控件的工具,并且支持如插入,删除...
- ASP教程
asp 标记字符串中指定字符变色不区分大小写
今天遇到这种问题,单纯的使用replace函数不行,他会改变原有的字符串的大小写,在网上找到相关的代码,自己备份下...
- ASP教程
asp Access数据备份,还原,压缩类代码
asp Access数据备份,还原,压缩类实现代码,大家可以参考下。...