List Image by date in ASP

Ask a Question related to ASP, Design and Development.

  1. #1

    Default 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


    Sylvian Tam Guest

  2. Similar Questions and Discussions

    1. inserting date in form list
      I want to make a date list that lists the year but instead of adding every year on a line I want to make a loop do it at runtime....any ideas?
    2. display list date
      I have a column in my db that lists options seperated by commas. I want to list those options in a bullet style list. How do I parse the data in...
    3. Event csv list and pulling by date...
      Just started "playing" with php and have a question. I currently have a csv list such as this: 11-08-03 | Tournament | Chapman rules 12-18-03 |...
    4. Image list
      Hi all, I'm developing a simple application with Project Builder using Carbon (nib based). I'd like to create a list of pictures (like tumbnails...
    5. Why is module list so out of date?
      Does anyone know why http://cpan.org/modules/00modlist.long.html is so far out of date? $Revision: 3.112 $ $Date: 2002/08/27 23:28:18 $ -*-...
  3. #2

    Default Re: List Image by date in ASP

    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
    [url]www.dotnetbooks.com[/url]


    "Sylvian Tam" <sylvian@netvigator.com> wrote in message
    news:uHWp81CkDHA.2404@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
    >
    >

    Manohar Kamath [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139