...

View Full Version : reading contents of folder, then using each file in JS



canadianjameson
08-11-2004, 04:32 PM
hey. i usually post in the JS & html/CSS forums... but i felt i needed a change :)

I'm trying to do something which, in my mind, should be relatively simple. i'm basically lazying out and want to do as follows. I just had a baby boy and have buttloads of pictures on my computer. i want to make a slideshow for various people who are hounding me to see pictures. that being said, i dont want to rename 100+ pictures and add them to an array for the JS slideshow.

so here's what i want to do. using a variation on this script i found below, i wish to read all the file names (in whatever order the appear in the folder (or dir, whatever). what i need help with is altering the code so that it reads the first file name, and sets variable A to that filename.

i want to pass variable A to the JS script son on so that i can have a slideshow without having to rename each file



<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test\")for each x in fo.files
'Print the name of all files in the test folder
Response.write(x.Name & "<br />")
nextset fo=nothing
set fs=nothing
%>


this script needs modifying, and my ASP knowledge consists of being able to spell ASP :P

any help would be appreciated :D

Roy Sinclair
08-11-2004, 10:32 PM
Would this link be any help?
http://aspnet.4guysfromrolla.com/articles/070704-1.aspx

canadianjameson
08-12-2004, 02:12 AM
looks PERFECT!.

but i have to get on a computer with the ability to test it

and do so.

but i'll let you know. Thanks Roy.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum