A collection of file objects with in a folder.
For Web-based scripts, the number of entries depends on the user rights.
Returns the number of items in a collection object.
object.Count
Long.
Read-only.
See sample in Example.
Returns TRUE if there is any file in Section 11.6, FilesCollection.
object.HasMoreElements
None.
Boolean.
See sample in Example.
Returns the next file object from the Section 11.6, FilesCollection. If there are no more files in the collection it returns NULL.
object.Next
None.
Folder.
See sample in Example.
Resets the collection of the files in the Section 11.6, FilesCollection object.
object.Reset
None.
Void.
This example resets the collection.
<% Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder ("Sys:\nsn\user")
Set Files = Folder.Files
’Returns the number of files in the folder collection
Response.Write Files.Count %>
<%’Resets the collection
Files.Reset()
’Checks for files in the collection
Do While Files.HasMoreElements()
For each file in Files
Response.Write File.Name
Next
’Sets the pointer to the next file in the collection
Files.Next()
Loop %>
Returns an item based on the specified filename.
object.Item(
FileName As String)
This example returns the file object.
<% Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder ("Sys:\nsn\user")
Set Files = Folder.Files
Set File = Files.Item ("date.bas")%>