OBJECT:  Files Collection

Implemented in version 3.0
 
The Files collection contains a set of File objects and is usually stored as a property of another object, such as a Folder object.

The following code demonstrates how to get a Files collection and list the contents in the browser.

Code:
<%
Dim filesys, demofolder, fil, filecoll, filist
Set filesys = CreateObject("Scripting.FileSystemObject")
Set demofolder = filesys.GetFolder("foldername") 
Set filecoll = demofolder.Files

For Each fil in filecoll
    filist = filist & fil.name 
    filist = filist & "<BR>" 
Next  
Response.Write filist
%>

PROPERTIES

Count Property
Returns an integer that tells us how many File objects there are in the collection.

Syntax: object.Count

Item Property
The Item property allows us to retreive the value of an item in the collection designated by the specified key argument and also to set that value by using itemvalue.

Syntax: object.Item(key) [ = itemvalue]
 


Copyright 1999-2004 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information