programming-examples/asp/More_Code_Snippets/Display all files in a directory.asp

19 lines
457 B
Plaintext
Raw Permalink Normal View History

2019-11-18 14:25:58 +01:00
<%
Dim objFSO , objFolder , file
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath("images/"))
For Each file in objFolder.SubFolders
%>
<a href="images/<%= file.Name %>"><%= file.name %></a><br>
<%
Next
%>
<%
For Each file in objFolder.Files
%>
<a href="images/<%= file.name %>"><%= file.name %></a><br>
<%
Next
Set objFolder = Nothing
Set objFSO = Nothing
%>