您的位置:程序门 -> web 开发 -> asp



高分求:思想方法,最好有例子!


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


高分求:思想方法,最好有例子!
发表于:2007-01-07 17:52:57 楼主

不想通过数据库实现以下功能,因所有文件将通过ftp直接上传。  


a:对根目录所有文件夹进行列表,而且可以进行分页。

b:能读取子目录所有文件名字,并进行分页,点击进行下载。

c:能实现大类,小类,搜索。

如大类:为根目录名称,子目录名称。最后可以搜索文件名。
发表于:2007-01-07 19:40:501楼 得分:0
加分到100
发表于:2007-01-07 21:03:552楼 得分:0
下载的话自己另外写个http头
用fso实现遍历的代码     希望对你有用

<%@   language   =   vbscript   %>
<%server.scripttimeout=5000%>

<html>
<head>
<title> files </title>
<link   rel= "stylesheet "   type= "text/css "   href= "ase.css ">
</head>

<body   topmargin=0>
<%
thisdir=request( "spath ")
if   thisdir= " "   then
thisdir= ". "
end   if
set   fs=server.createobject( "scripting.filesystemobject ")
set   fdir=fs.getfolder(thisdir)

response.write   " <table   width= '100% '   cellpadding= '2 '   cellspacing= '2 '> "
response.write   " <tr> <td> &nbsp; </td> <td   bgcolor= '#cccccc '> 名称 </td> <td   bgcolor= '#cccccc '> 大小 </td> <td   bgcolor= '#cccccc '> 类型 </td> <td   bgcolor= '#cccccc '> 修改时间 </td> </tr> "
'response.write   "目录列表: <br> "
for   each   thing   in   fdir.subfolders
response.write   " <tr> <td> &nbsp; </td> <td   colspan= '4 '> <img   src= 'images/folder.gif '> <a   href= 'files.asp?spath= "   &   thisdir   &   "\ "   &   thing.name   &   " '> "   &   thing.name   &   " </a> </td> </tr> "
next

'response.write   "文件列表: <br> "
dim   strext
for   each   thing   in   fdir.files
response.write   " <tr> <td> "
'checkbox   for   select
response.write   " <input   type= 'checkbox '   name= ' "&thing.name& " '> </td> "
'file   name

strext=lcase(right(thing.name,4))
select   case   strext
case   ".htm "
response.write   " <td> <img   src= 'images/html.gif '> "   &   thing.name   &     " <a   href= 'edit.asp?filename= "&thisdir& "/ "&thing.name& "&task=read '> <img   src= 'images/edit.gif '   width=16   height=16   border=0   alt= '编辑 '> </a> </td> "

case   "html "
response.write   " <td> <img   src= 'images/html.gif '> "   &   thing.name   &     " <a   href= 'edit.asp?filename= "&thisdir& "/ "&thing.name& "&task=read '> <img   src= 'images/edit.gif '   width=16   height=16   border=0   alt= '编辑 '> </a> </td> "
case   ".asp "
response.write   " <td> <img   src= 'images/asp.gif '> "   &   thing.name   &   " <a   href= 'edit.asp?filename= "&thisdir& "/ "&thing.name& "&task=read '> <img   src= 'images/edit.gif '   width=16   height=16   border=0   alt= '编辑 '> </a> </td> "
case   ".cgi "
response.write   " <td> <img   src= 'images/perl.gif '> "   &   thing.name   &     " <a   href= 'edit.asp?filename= "&thisdir& "/ "&thing.name& "&task=read '> <img   src= 'images/edit.gif '   width=16   height=16   border=0   alt= '编辑 '> </a> </td> "

case   ".txt "
response.write   " <td> <img   src= 'images/txt.gif '> "   &   thing.name   &   " <a   href= 'edit.asp?filename= "&thisdir& "/ "&thing.name& "&task=read '> <img   src= 'images/edit.gif '   width=16   height=16   border=0   alt= '编辑 '> </a> </td> "
case   ".gif "
response.write   " <td> <img   src= 'images/gif.gif '> "   &   thing.name   &   " </td> "
case   ".jpg "
response.write   " <td> <img   src= 'images/jpg.gif '> "   &   thing.name   &   " </td> "
case   ".zip "
response.write   " <td> <img   src= 'images/zip.gif '> "   &   thing.name   &   " </td> "
case   ".exe "
response.write   " <td> <img   src= 'images/exe.gif '> "   &   thing.name   &   " <a   href= 'fileop.asp?filename= "&thisdir& "/ "&thing.name& "&action=EXECute '> <img   src= 'images/EXECute.gif '   width=16   height=16   border=0   alt= '执行 '> </a> </td> "
case   else
if   right(thing.name,3)= ".pl "   then
response.write   " <td> <img   src= 'images/perl.gif '> "   &   thing.name   &     " <a   href= 'edit.asp?filename= "&thisdir& "/ "&thing.name& "&task=read '> <img   src= 'images/edit.gif '   width=16   height=16   border=0   alt= '编辑 '> </a> "
else
response.write   " <td> <img   src= 'images/unknown.gif '> "   &   thing.name   &   " </td> "
end   if
end   select
'file   properties
response.write   " <td> "   &   cstr(thing.size)   &   " </td> <td> "   &   thing.type   &   " </td> <td> "   &   cstr(thing.datelastmodified)   &   " </td> </tr> "
next


response.write   " </table> "
%>

</body>
</html>
发表于:2007-01-07 22:00:083楼 得分:0
别找了,去下个海洋顶端瞧瞧
发表于:2007-01-11 15:10:154楼 得分:0
我试下


快速检索

最新资讯
热门点击