ASP 文件集合
ASP 文件集合用于返回指定文件夹中存在的所有文件的集合。这些可以循环通过以获取各个文件的详细信息。
句法:
FolderObject.Files
示例:下面的代码演示了 ASP File.Files 集合。
ASP
<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
'Get the folder to be read
set fo=fs.GetFolder("d:\geeks\")
'Loop through the files present in the folder
for each x in fo.files
'Print the name of the file
Response.write("Filename: " & x.Name & "
")
next
set fo=nothing
set fs=nothing
%>
输出:
Filename: GFG_adv.txt
Filename: sudo.txt
Filename: ram.txt
Filename: shyam.txt