|
 |
asp_web_howto thread: Re: counting files
Message #1 by "daydreamer" <demaerek@y...> on Fri, 10 May 2002 19:44:36
|
|
> Hello guys!
>
> Does somebody know hao to count the number of the files contained into a
> folder?
>
> I need to create a page for a photo gallery.
> This page will have to build the thumbnails table adding one cell for
each
> image file (thumbnail) contained in the thumbs folder.
>
> I couldn't find anything in the archive of this forum.
>
> Thank you everybody!
>
> Gabriele
Message #2 by "Drew, Ron" <RDrew@B...> on Fri, 10 May 2002 14:42:28 -0400
|
|
<%
Dim fso, folder, strmy, hit
hit =3D 0
Set fso =3D Server.CreateObject("Scripting.FileSystemObject")
Set folder =3D fso.GetFolder(Server.MapPath("..\xxxx\images"))
' or the physical path
'Set folder =3D fso.GetFolder("c:\InetPub\wwwroot\xxxx\images\")
If folder.Size > 0 Then
For Each file in folder.Files
if Left(file.Name,6) =3D strmy then
hit =3D hit + 1
end if
next
end if
%>
Hit now has the number of entries in the folder
-----Original Message-----
From: daydreamer [mailto:demaerek@y...]
Sent: Friday, May 10, 2002 3:45 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: counting files
> Hello guys!
>
> Does somebody know hao to count the number of the files contained into
> a
> folder?
>
> I need to create a page for a photo gallery.
> This page will have to build the thumbnails table adding one cell for
each
> image file (thumbnail) contained in the thumbs folder.
>
> I couldn't find anything in the archive of this forum.
>
> Thank you everybody!
>
> Gabriele
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
|
|
 |