Vis med FSO hvilket filer der er i mappen
HejHvordan får jeg følgende script til at vise f.eks. at det er MS Word ell. Excel filer der er i mappen:
<%
ImageDir = "../aplan/old/" ' Mappen med filerne'
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(Server.MapPath(ImageDir))
Set objFiles = objFolder.Files
intPage = Request.Querystring("page")
If isNumeric(intPage) = False Or intPage < 1 Then
intPage = 1
End If
intPageSize = 1 ' Antal filer på hver side'
intImgCount = objFiles.Count
intPageCount = -Int(-(intImgCount/intPageSize))
Response.Write "<p><strong>" & intImgCount & " files - "
Response.Write "showing page " & intPage & " of " & intPageCount & ":</strong></p>"
For Each Image In objFiles
intFile = intFile +1
If (intFile >= ((intPage-1)*intPageSize)+1) And (intFile =< (intPageSize*intPage)) Then
Response.Write "<p><HREF='" & ImageDir & Image.Name & "' /></p>"
End If
Next
strScriptName = Request.Servervariables("ScriptName")
Response.Write "<p>Go to page "
For i = 1 To intPageCount
Response.Write "<a href=" & strScriptName & "?page=" & i & ">" & i & "</a> "
Next
Response.Write "</p>"
Set objFS = Nothing
%>