Hej alle.
Jeg har lavet et lille script der skriver filerne der ligger i en mappe. Koden kan ses herunder..
Hvordan får jeg den til at udskrive i omvendt rækkefølge?
Min kode:
<%
sub ListFolderContents(path)
dim fs, folder, file, item, url
set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
for each item in folder.Files
arrM = split(item.name,".")
if right(item.name,3) = "TXT" or right(item.name,3) = "txt" Then pdfsize = "16" else pdfsize = "1" end if
%>
<tr target="_blank" onClick="parent.location='download.asp?type=<%=right(item.name,3)%>&name=<%=arrM(0)%>'" onMouseOver="style.cursor='hand',bgColor='#F3F2ED'" onMouseOut="bgColor='#ffffff'">
<td align="left" style="border-bottom:solid 1pt #EAEBE5;"> <%if right(item.name,3) = "PDF" or right(item.name,3) = "pdf" Then response.Write("<img src='images/pdf.gif' border='0'> ") end if%><%if right(item.name,3) = "TXT" or right(item.name,3) = "txt" Then response.Write("<img src='images/pdf.gif' border='0'> LAB nr. ") end if%><%if right(item.name,3) = "XLS" or right(item.name,3) = "xls" then response.Write("<img src='images/xls.gif' border='0'> ") end if%><%=arrM(0)%></td>
<td align="right" style="border-bottom:solid 1pt #EAEBE5;"><%if item.size > 1024 then response.write(Round(item.Size / 1024 * pdfsize) & " KB") else response.write(item.size & " Bytes") end if%></td>
<td align="right" style="border-bottom:solid 1pt #EAEBE5;"><%if right(item.name,3) = "PDF" or right(item.name,3) = "pdf" Then response.Write("PDF-fil") end if%><%if right(item.name,3) = "TXT" or right(item.name,3) = "txt" Then response.Write("PDF-fil") end if%><%if right(item.name,3) = "XLS" or right(item.name,3) = "xls" then response.Write("XLS-fil") end if%></td>
<td align="right" style="border-bottom:solid 1pt #EAEBE5;"><%=item.datelastmodified%> </td>
</tr>
<%
next
end sub
%>