473,624 Members | 2,232 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("S cripting.FileSy stemObject")
Set ffolder = fso.GetFolder(f olderspec)
Set fc = ffolder.Files

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

'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 2544
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.CreateOb ject("ADODB.Rec ordSet")
filesRs.CursorL ocation = 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("FileDa te") = CDate(ffile.Cre ateDate) ' Check the property

filesRs("FileNa me") = 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*****@netvig ator.com> wrote in message
news:uH******** ******@TK2MSFTN GP12.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("S cripting.FileSy stemObject")
Set ffolder = fso.GetFolder(f olderspec)
Set fc = ffolder.Files

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

'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
4155
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 why it doesn't work? Thanks in advance Tjerk
6
4744
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 Halloween 10/15 - 11/1 etc. etc. If the date doesn't fall in any upcoming holiday ranges, then the default image is displayed.
15
5328
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 path of the uploaded image, and resize it with the provided dimensions. My function is below. The current function is returning an error when run from the upload function: A generic error occurred in GDI+. Not sure what exactly that means. From what...
1
15224
by: wdw1970 | last post by:
Hello Everyone! This is my first post to the forum. --------------------------------------------------------------------------------------------- In my database, I have a continuous subform called: "subCallBack". I setup my query, so that it only shows records that do contain a date value, in the "lsrCallBackDate" column. Any record within this subform, is one of our customers that our employee needs to call on a certain date....
9
2579
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" runat="server"/> <asp:Label ID="CompanyPicture" runat="server"/> I have 2 links that open the windows to preview these images. The previewed images are done on separate html pages that do nothing but display the
7
3780
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. time / date Nice to have:
3
2084
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")) { $errmsg = "Cannot connect to database"; }
1
2016
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 and after displayed it.plz tell that how to start the logic. <?php // Connect to database $errmsg = "";if (! @mysql_connect("localhost","root","sreeni")) { $errmsg = "Cannot connect to database"; } @mysql_select_db("my_db1");...
12
2901
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 homepage. One day, I thought: Why not just make a little program in C#, that just shows me the .gif-picture of the strip? And so I did. Or, more correctly, I tried to do.
0
8242
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8681
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8629
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7170
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1488
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.