Display directory contents - sorted by date.

Results 1 to 2 of 2

Thread: Display directory contents - sorted by date.

  1. #1
    Join Date
    Dec 1969

    Default Display directory contents - sorted by date.

    Hi,<BR><BR>I have a piece of code which displays the contents of a directory with a particular file extension, but doesn&#039;t follow the way it is sorted in the directory; it just displays it in alphabetical order.<BR><BR>Is there anyway of getting the ASP to sort the files before it displays them so it when it does display they are in date order?<BR><BR>code:<BR><BR>Dim fs,fo,x,d<BR><BR>Set d=Server.CreateObject("Scripting.Dictionary")<BR>S et fs=server.createobject("scripting.filesystemobject ")<BR>Set fo = fs.getfolder("E:Inetpubwwwrootstats\")<BR><BR>For Each x in fo.Files<BR> <BR>If lCase(right(x.Name,4)) = ".xls" then <BR>Response.Write"&#060;a href=http://webserver/stats/"<BR>Response.Write"" & lcase(x.Name) & "&#062;" & lcase x.Name)<BR>Response.Write"&#060;/a&#062;"<BR> Response.Write"&#060;p&#062;"<BR> End if<BR>Next<BR><BR>set fo=nothing<BR>set fs=nothing<BR><BR>Cheers in advance.<BR><BR>Neil.

  2. #2
    Join Date
    Dec 1969

    Default ASPFAQs, category FileSystemObject

    There is a link to the ASPFAQs at the top right corner of this very page.<BR><BR>Look in the category noted in the subject line of this message for your question.<BR><BR>The ASPFAQs are your friends. Visit your friends often.<BR><BR>

Posting Permissions

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