I am using the Folder.Files collection to display all the images in a given
directory. The following shows the code I use to create and use this
collection:
Set myfilesys=Server.CreateObject("Scripting.FileSyste mObject")
Set mydirectory=myfilesys.GetFolder(Server.MapPath("./emoticons"))
When I use a specific file name to access a file, my code works fine:
<img src=" & Chr(34) & mydirectory.Name & "/" &
mydirectory.Files("blinkgirl.gif").Name & Chr(34) & ">
However, I want to iterate through all the files in the Folder USING NUMBERS
(I already know how to do it using a For Each statement). But whenever I try
to do this, I receive an error:
<img src=" & Chr(34) & mydirectory.Name & "/" & mydirectory.Files(5).Name
& Chr(34) & ">
Other collections, such as the Request.Form collection allow you to access
the collection using either text or numbers, and all books that I have read
have said that this is true for all collections. Is the Folder.Files
collection an exception to this? Is there something else I need to do? If
anybody can give me any help on this, I would appreciate it. Thank You.
--
Nathan Sokalski
nj********@hotmail.com
http://www.students.kutztown.edu/soka0908/HomePage.html