Get list of files

Which files are within my main folder?

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


 

Which files are within "cgi-bin" folder?

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


AspTutorial.info.