Features
Ask DevGuru
ASP Resources
Find the Bug
Knowledge Base
Links
Tips of the Week
Tutorials
Products
dgCalendar
dgCharge New!
dgChart New!
dgFileUpload
dgReport New!
dgSort
dgTree
Site
Authoring
Coming Soon
DevGuru Resume
Link to Us
Merchandise
Sponsorships
Testimonials
What's New
Technologies
ADO 2.6
ASP
CSS2
HTML
JavaScript
Jet SQL
Transact-SQL Syntax
VBScript
WML
WMLScript
WSH
XML DOM
All Objects
Drive Object
Drives Collection
File Object
Folder Object
Folders Collection
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-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information