472,364 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,364 software developers and data experts.

Sort list of files in directory


I'm beginning in the ASP world...

I would like to sort (descending) list of files in directory.

Parameter is directory url.

How I can to do that with ASP not ASP.NET.

Thank you very much.

Jul 19 '05 #1
2 14058
On Tue, 23 Dec 2003 21:16:40 +0100, "Jean-Paul Lauque"
<je**************@wanadoo.fr> wrote:

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

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.

Jul 19 '05 #2
And here are some related links:

Directory List (Sorted)
Puts file info into an ADO recordset and then sorts that.

How do I sort a file list alphabetically? - 7/16/2000

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

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

Similar topics

by: Mike Zupan | last post by:
I have a list that includes files and directories ie: list = I want to sort it so it looks like this I'm just wondering if there is an easy way to do this
by: Mary Jane Pronio | last post by:
What I want to do is take that output, use the data within it to put into a shell script as input to another installation of DB2 Connect on another AIX box. Any ideas about how to do this?
by: RML | last post by:
hey guys, i am looking at this piece of code that lists numbers of files in a directory. i want to convert it so it lists the files in th directory that end with .doc. i cant seem to get it to...
by: Don | last post by:
I intermittently get a runtime Compilation Error that says 'The compiler failed with error code 2000'. It appears that a DLL cannot be found in the 'temporary asp.net files' directory. The...
by: Shawn Mehaffie | last post by:
I have an application I want to be able to: 1) Store user specifc settings in ther "My Documents". 2) Store some information in "All Users" document directory. 3) I also want to be able to...
by: dcruncher4 | last post by:
DB2 8.2.3 is there a sql equivalent to get the information provided by db2 list node directory db2 list db directory. thanks.
by: mmohanra | last post by:
I am trying to list files in a folder in a remote server. I am using Scripting.FileSystemObject. This seems to be really slow. After a long time the connection times out. Is there any other way to...
by: froditus | last post by:
Hello everyone, is it possible to list files from directory other than in apache web directory? my web folder is placed on c:/ and i put my files in windows directory "d:/files/images/". I...
by: jr | last post by:
I created a simple class, have used it to populate a list (of myclass) - The class only contains a customer id and a date. I would like to sort this list based on most recent date to the oldest....
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.