jammer20002
11-06-2003, 07:53 PM
I need to create a dynamic page that reads the names of images in a directory and then with that constructs a page to show the images as thumbnails ona HTML page.
What's the best way to read in a directory?
I've been trying to copy someone elses code, which is the following:
set fso = server.CreateObject("scripting.filesystemobject")
set fol = fso.getfolder(server.MapPath(images_directory_name))
for each fil in fol.files
do some actions.
next
set fol = nothing
set fso = nothing
The problem is that the above code takes a long time to execute! Is there a better way?
Surely, the best way would be to get a directory listing, and then strip out the image names? Instead of doing actions while the fol and fso objects are open?
I'm really new to ASP (and VBScript) so... I don't have much clue what the best solution is.
ANY help wouldbe appreciated.
Thanks.
Jam
What's the best way to read in a directory?
I've been trying to copy someone elses code, which is the following:
set fso = server.CreateObject("scripting.filesystemobject")
set fol = fso.getfolder(server.MapPath(images_directory_name))
for each fil in fol.files
do some actions.
next
set fol = nothing
set fso = nothing
The problem is that the above code takes a long time to execute! Is there a better way?
Surely, the best way would be to get a directory listing, and then strip out the image names? Instead of doing actions while the fol and fso objects are open?
I'm really new to ASP (and VBScript) so... I don't have much clue what the best solution is.
ANY help wouldbe appreciated.
Thanks.
Jam