一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

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

时间:2008-12-19 编辑:简简单单 来源:一聚教程网

<%  
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 & "
") 
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 & "
") 
Next 
%>

好了就OK

热门栏目