Jacob Christiansen wrote:
> dav.
> er det muligt via asp at liste alle foldere og filer i en
> bestemt mappe ?
Her er en anden mulig løsning, der desværre heller ikke lister mapper:
<kode start>
<% session.LCID = 1030 %>
<%
dim strPathInfo, strPhysicalPath
strPathInfo = Request.ServerVariables("PATH_INFO")
strStiInfo = Request.ServerVariables("server_name")
strPhysicalPath = Server.MapPath(strPathInfo)
Dim objFSO, objFile, objFileItem
Set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.GetFile(strPhysicalPath)
set objFolder = objFile.ParentFolder
set objFolderContents = objFolder.Files
%>
<h1>
<%
streng= Request.ServerVariables("PATH_INFO")
sidsteslash = InStrRev(streng, "/")
stien = Left(streng, sidsteslash)
Response.write Request.Servervariables("Server_Name") & stien
%>
</h1>
<div style="width:100%; text-align:center;">
<div style="background-color:#ffffdd;width:1;padding:10px;border:solid black
1">
<table border="0" cellpadding="3" cellspacing="0">
<tr>
<td><b>Filnavn</b></td>
<td><b>Størrelse</b></td>
<td> </td>
<td nowrap><b>Sidst opdateret</b></td>
</tr>
<%
For Each objFileItem in objFolderContents
Response.Write "<tr><td nowrap>"
Response.Write "<a href='"
Response.Write objFileItem.Name
Response.Write "'>"
Response.Write objFileItem.Name
Response.Write "</a>"
Response.Write "</td><td align='right' nowrap>"
Response.Write objFileItem.size
Response.Write "</td><td> </td><td align='right' nowrap>"
Response.Write objFileItem.DateLastModified
Response.Write "</td></tr>"
Next
%>
</table>
</div>
</div>
</kode slut>
--
Med venlig hilsen
Erik Ginnerskov
http://hjemmesideskolen.dk -
http://html-faq.dk
http://ginnerskov.frac.dk/