天涯之外

导航

asp 显示文件夹下面所有文件代码

<%  
Whichfolder=server.mappath("") &"/" 
Dim fs, f, f1, fc 
Set fs = CreateObject("Scripting.FileSystemObject") 
Set f = fs.GetFolder(Whichfolder) 
Set fc = f.files

For Each f1 in fc 
 Response.write (f1.name & "<BR>") 
Next 
%>

实例二.
<%  
Whichfolder=server.mappath("") &"/cgi-bin/" 
Dim fs, f, f1, fc 
Set fs = CreateObject("Scripting.FileSystemObject") 
Set f = fs.GetFolder(Whichfolder) 
Set fc = f.files

For Each f1 in fc 
 Response.write (f1.name & "<BR>") 
Next 
%>

posted on 2009-11-12 17:16  天涯之外  阅读(321)  评论(0编辑  收藏  举报