|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
sort filenames with download links by date - multidimensional array ??
hi fellas !
i use this script to generate download links from directories which are first passed to an script to record the number a link is clicked. the function is calle with a path like: ListFolderContents(Server.MapPath("/dir1")) my question now is: can i write this to an multidimensional array (or object oriented?) - and then sort it by date ?? if so how ? any ideas ? thx <% sub ListFolderContents(path) dim fs, folder, file, item, url, a set fs = CreateObject("Scripting.FileSystemObject") set folder = fs.GetFolder(path) 'Display the target folder and info. Response.Write("<li><span class="""& cold &""">" & folder.Name _ &"</span>") Response.Write("<ul>" & vbCrLf) 'Display a list of sub folders. for each item in folder.SubFolders ListFolderContents(item.Path) next 'Display a list of files. for each item in folder.Files url = MapURL(item.path) helpurl = url Response.Write("<li><a href=""../asp/clicks.asp?url=" & url & """>" & item.Name & "</a> - <span class=""grey"">Downloads:["&hold1&"] - " &_ (Round(item.Size/1024/1024, 2)) & " MB, " _ & " " & item.DateLastModified & "." _ &"</span></li>") next Response.Write("</ul>" & vbCrLf) Response.Write("</li>" & vbCrLf) end sub function MapURL(path) dim rootPath, url 'Convert a physical file path to a URL for hypertext links. rootPath = Server.MapPath("../../..") url = Right(path, Len(path) - Len(rootPath)) MapURL = Replace(url, "\", "/") end function %> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > sort filenames with download links by date - multidimensional array ?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|