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