On Tue, 23 Dec 2003 21:16:40 +0100, "Jean-Paul Lauque"
<je**************@wanadoo.fr> wrote:
Hello,
I'm beginning in the ASP world...
I would like to sort (descending) list of files in directory.
Parameter is directory url.
Use the File System Object to retrieve the files collection.
Something like:
==============
' Get the folder needed from a query string
' could be Request.Form or whatever
Folder = Request.QueryString("Folder")
' Use the FSO to get the files collection
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set DisplayFolder = FileSystem.GetFolder(server.mappath(Folder))
Set DisplayFiles = DisplayFolder.Files
' Display each file on a line in a web page
For Each FileName in Files
response.write FileName.Name & "<br>" & VbCrLf
Next
==============
The files are already sorted descending order, but you could load them
into an array and sort to your heart's content if you wish.
Jeff