ASP List Folder (List Directory) ตัวอย่างนี้เป็นการแสดงชื่อโฟเดอร์ย่อยทั้งหมด
Syntax
<%
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath("Folder"))
%>
ASPFolderObjectSubFolder.asp
<% Option Explicit %>
<html>
<head>
<title>ThaiCreate.Com ASP Folder Object</title>
</head>
<body>
<%
Dim objFSO,objFolder,Vol
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath("MyFiles"))
For Each Vol in objFolder.SubFolders
Response.write(Vol.Name&"<br>")
Next
Set objFolder = Nothing
Set objFSO = Nothing
%>
</body>
</html>