B-One probs igen
hvad er der så galt med linien: with response? (virker ikke på b-one, men alle andre steder)Denne fil hedder imageBOX.asp og bruges til at vise billeder i en mappe (uden at man ved hvad billederne hedder)
<%
'**********************
'**********************
'determine which file are to be shown
'to add more simply add a new extension to the values seperated by commas
aFilesSTR = "jpg,gif,bmp,png"
'how many images to show?
showCount = 1
'set the title of your gallery
galleryTitle = "My Image Gallery"
'**********************
'**********************
afilesARR = split(aFilesSTR,",")
dim iStart
dim iStop
if request.querystring("iStart") = "" then
iStart = 0
else
iStart = request.querystring("iStart")
end if
iStop = iStart + (showCount - 1)
with response
.write "<h1" & galleryTitle & "</h1>"
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(Server.Mappath("."))
Set files = folder.Files
dim printARR()
For Each file in Files
if isAllowed(file.name) then
redim preserve printARR(y)
printARR(y) = file.name
y = y + 1
end if
next
.write "<table border=""0"" width=""100%"">"
.write "<tr>"
.write "<td width=""25%"">"
if iStart > 0 then
response.write "<a href=""imagebox.asp"">First</a><br><br>"
end if
.write "</td>"
.write "<td width=""25%"">"
if iStart > 0 then
response.write "<a href=""imagebox.asp?iStart=" & iStart - 3 & """>Previous</a><br><br>"
end if
.write "</td>"
.write "<td width=""25%"">"
if iStop < (ubound(printARR) * 1) then
response.write "<a href=""imagebox.asp?iStart=" & iStop + 1 & """>Next</a><br><br>"
end if
.write "</td>"
.write "<td width=""25%"">"
if iStop < ubound(printARR) then
response.write "<a href=""imagebox.asp?iStart=" & ubound(printARR) - 2 & """>Last</a><br><br>"
end if
.write "</td>"
.write "</tr></table>"
if ubound(printARR) < iStop then
iStop = ubound(printARR)
end if
for i = iStart to iStop
response.write "<img src=""" & printARR(i) & """><br /><br />"
next
end with
Set files = folder.Files
Set file = Nothing
Set fso = Nothing
function isAllowed(var)
isAllowed = false
newARR = split(var,".")
newvar = lcase(newARR(ubound(newARR)))
for i = 0 to ubound(afilesARR)
if newvar = lcase(aFilesARR(i)) then
isAllowed = true
end if
next
end function
%>