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

热门教程

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

时间:2022-06-30 11:42:05 编辑:袖梨 来源:一聚教程网

<%  
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

热门栏目