|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Question
How to retrieve "Last modified" & "FileName" from all files in a specific folder (called MyDocs) and display on the ASP page? eg. (in MyDocs folder) - MikesWork.doc - MyResume.xls - HouseExpenses.xls Situation Let's assume that i just modified MyResume.xls file and save it today(10/30/2003) on my computer, then i upload it into the internet. On my asp page, i want to show all files Filename (Last Modified) in MyDocs folder. eg. Your Documents 1. MikesWork.doc (last modified 10/24/2003) 2. MyResume.xls (last modified 10/30/2003) 3. HouseExpenses.xls (last modified 9/15/2003) I know it has to do with fso or something close to it... but totally have no idea (zero) of its logic or how it works. Please help me by giving me with full example. Thanks a lot in advance.
__________________
Hope this helps. Mike Royal Selangor Pewter "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931) |
|
#2
|
|||
|
|||
|
After some thorough browsing thru the internet and modified here and there, i finally got it.
Here is the sample, if any of you guys are interested as well. Code:
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'Get the folder object associated with the directory
Dim objFolder
Set objFolder = objFSO.GetFolder("C:\research\mydocs")
Response.Write "Your Documents<br>"
'Loop through the Files collection
Dim objFile
For Each objFile in objFolder.Files
Response.Write objFile.Name & " (last modified " & objFile.DateLastModified & ")<br>"
Next
'Clean up!
Set objFolder = Nothing
Set objFile = Nothing
Set objFSO = Nothing
|
|
#3
|
|||
|
|||
|
Order by latest date
now i want to order by latest date to oldest date. anyone know how to go about it? i can't find anywhere in the internet about this.
thanks. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Retrieving properties of filename to display on web |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|