programming-examples/asp/More_Code_Snippets/Display all files in a directory.asp
2019-11-18 14:25:58 +01:00

19 lines
457 B
Plaintext

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