473,500 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List Image by date in ASP

Hi all,

I am using the File System Object to get a list of image through a specified
local path :

Dim fso, ffolder, ffile, fc, fproperity, strOut, strPic
Set fso = CreateObject("Scripting.FileSystemObject")
Set ffolder = fso.GetFolder(folderspec)
Set fc = ffolder.Files

For Each ffile in fc
intCount = intCount + 1
strPic = strPhotoPath & ffile.name
Set fproperity = fso.GetFile(strPic)

'show image one by one...

Next
I found that the image will be display by file name by default, is there any
way to show them by the created date or last accessed date?

Is there any way in doing this?

Thanks
Sylvian
Jul 19 '05 #1
1 2537
As you loop through the files, create a recordset with file name and file
date. Then you can sort this recordset however you want.

' Create a custom recordset
Set filesRs = Server.CreateObject("ADODB.RecordSet")
filesRs.CursorLocation = 3 ' adUseClient
filesRs.Fields.Append "FileDate", adDate
filesRs.Fields.Append "FileName", adVarChar, 255
filesRs.Open

For Each ffile in fc
intCount = intCount + 1
strPic = strPhotoPath & ffile.name

...
filesRs.AddNew
filesRs("FileDate") = CDate(ffile.CreateDate) ' Check the property

filesRs("FileName") = CStr(ffile.Name) ' Check the property

Loop

' Sort the recordset on FileDate and proceed
filesRs.Sort = "FileDate ASC"

Hope that helps.

--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com
"Sylvian Tam" <sy*****@netvigator.com> wrote in message
news:uH**************@TK2MSFTNGP12.phx.gbl...
Hi all,

I am using the File System Object to get a list of image through a specified local path :

Dim fso, ffolder, ffile, fc, fproperity, strOut, strPic
Set fso = CreateObject("Scripting.FileSystemObject")
Set ffolder = fso.GetFolder(folderspec)
Set fc = ffolder.Files

For Each ffile in fc
intCount = intCount + 1
strPic = strPhotoPath & ffile.name
Set fproperity = fso.GetFile(strPic)

'show image one by one...

Next
I found that the image will be display by file name by default, is there any way to show them by the created date or last accessed date?

Is there any way in doing this?

Thanks
Sylvian

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4132
by: Tjerk | last post by:
Hello all, I have the script below to change an image depending on the date upto january it worked fine but then it just stopped working does anybody have an idea how I can make it work again or...
6
4726
by: Yeah | last post by:
I have alternate holiday headers for my web site, and I would like to display a certain image for an upcoming holiday. Examples: Christmas 12/10 - 12/26 New Years Eve 12/27 - 1/2...
15
5298
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
1
15176
by: wdw1970 | last post by:
Hello Everyone! This is my first post to the forum. --------------------------------------------------------------------------------------------- In my database, I have a continuous...
9
2564
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
7
3765
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g....
3
2073
by: Eminosoft | last post by:
The below code can't take the images.plz tell that what is the problem in that code <?php // Connect to database $errmsg = ""; if (! @mysql_connect("localhost","root","sreeni")) { ...
1
2002
by: sravani1 | last post by:
This code runs like when i submit the form it takes the image and displayed and top of the image a map will displayed. But actually i want that when i give the image it checks the location in the map...
12
2877
by: Mads Aggerholm | last post by:
Hello Sirs I hope you can give me a hint to this little problem. The thing is, I have for a lang time enjoyed the comics on www.washintonpost.com, and I allways start the day by going to their...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.