类似于iis浏览的功能
f,f。
host,--- % const_domain_name为域名最后不要加斜杠 const const_domain_name= % style b,s Setfso=CreateObject( Scripting.FileSystemObject ) Setf=fso.GetFolder(display_cur_path) setfs=f.SubFolders Setfc=f.Files ForEachfss in fs dimfolder_name folder_name=fss.name % ahref= folder_list.asp?act=list_curcur_path=%=fss% spanstyle= font-family:wingdings 0/span%=folder_name%/abr % Next % % ForEachf1 in fc dimfilename filename=f1.name % ahref= %=p2v_path(f1)% spanstyle= font-family:wingdings2 //span%=filename%/abr % Next setfso=nothing onerror goto 0 endsub ---------------------------------------------得到上级目录的路径 function get_parent_folder() onerrorresumenext str=display_cur_path str_find= \ str_int=InStrRev(str,f1,s Setfso=CreateObject( Scripting.FileSystemObject ) Setf=fso.GetFolder(request( cur_path )) setfs=f.SubFolders Setfc=f.Files ForEachfss in fs dimfolder_name folder_name=fss.name % ahref= folder_list.asp?act=list_curcur_path=%=fss% spanstyle= font-family:wingdings 0/span%=folder_name%/abr % Next % % ForEachf1 in fc dimfilename filename=f1.name % ahref= %=p2v_path(f1)% spanstyle= font-family:wingdings2 //span%=filename%/abr % Next setfso=nothing endsub % % ------------------------------------------------显示上级目录的子目录和子文件 sublist_parent onerrorresumenext Dimfso,fc,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 setfso=nothing end function submain % ahref= folder_list.asp?act=list_parentcur_path=%=get_parent_folder% 向上/abahref= javascript:void(null) %=display_cur_path%/a/Bp % select case request( act ) case list_parent list_parent case list_cur list_cur case else list endselect endsub 。
fc, !---将此文件存为folder_list.asp看看效果就知道了加上权限就可以方便自己了,f1,str_int) err.clear end function -----------------------------------------------将文件路径转为www发布的路径这样就可以下载了 function p2v_path(p_path) p_path为硬盘上的物理路径 dimhost host=lcase(server.MapPath( \ )) p_path=lcase(p_path) p2v_path=replace(p_path,a{font-size:9pt;line-height:150%;text-decoration:none;color:#0000cc;} span{font-size:12pt;} /style % ------------------------------------------------显示当前目录下的子目录和文件 sublist Dimfso,fc,str_find)-1得到上一级目录的路径 get_parent_folder=mid(str,f,1,img,s Setfso=CreateObject( Scripting.FileSystemObject ) Setf=fso.GetFolder(server.MapPath( . )) setfs=f.SubFolders Setfc=f.Files ForEachfss in fs dimfolder_name folder_name=fss.name % ahref= folder_list.asp?act=list_curcur_path=%=fss% spanstyle= font-family:wingdings 0/span%=folder_name%/abr % Next % % ForEachf1 in fc dimfilename filename=f1.name % ahref= %=p2v_path(f1)% spanstyle= font-family:wingdings2 //span%=filename%/abr % Next setfso=nothing endsub % % ------------------------------------------------显示指定路径下的目录和文件 sublist_cur Dimfso,f1,。
相关热词:
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/jiaob/asp/9032.shtml
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
所有我们手工回收一下就
时间:2021-01-18
-
最近网站改版正好发现原
时间:2021-01-17
-
现在完全支持ACCESS
时间:2021-01-17
-
出现错误的时候
时间:2021-01-13
-
ASP常见错误详解及解决方
时间:2021-01-05
-
查看ASP详细错误提示信息
时间:2021-01-05
-
4款傻瓜型的ASP服务器软件
时间:2020-12-23
-
ASP 数字分页效果代码
时间:2020-12-23
热门文章
-
出现错误的时候
时间:2021-01-13
-
查看ASP详细错误提示信息的图文设置方法
时间:2021-01-05
-
所有我们手工回收一下就可以了
时间:2021-01-18
-
one.asp多项目、函数库、类库 统一为一个
时间:2020-12-23
-
ASP下通过Adodb.Stream实现多线程下载大文件
时间:2020-12-23
-
asp在iis7报错行号不准问题的解决方法
时间:2020-12-23
-
4款傻瓜型的ASP服务器软件(asp运行环境一
时间:2020-12-23
-
最近网站改版正好发现原来的分页不带数
时间:2021-01-17
-
ASP和PHP文件操作速度的对比
时间:2020-12-23
-
现在完全支持ACCESS
时间:2021-01-17
