Bộ sưu tập tệp ASP
❮ Tham chiếu đối tượng thư mục hoàn chỉnh
Bộ sưu tập Tệp trả về một bộ sưu tập tất cả các tệp trong một thư mục được chỉ định.
Cú pháp
FolderObject.Files
Thí dụ
<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test\")
for each x in fo.files
'Print the name of all files in the test folder
Response.write(x.Name & "<br>")
next
set fo=nothing
set fs=nothing
%>
Đầu ra:
test_adv.txt
guestbook.txt
links.txt
links2.txt
textads.txt
textfile.txt
❮ Tham chiếu đối tượng thư mục hoàn chỉnh