Billede galleri fejl
HejFår følgende fejl ved at køre dette her script.
Error Type:
Sun ONE ASP VBScript runtime (0x800A004C)
Path not found
/billeder/musikbilleder/visbillede.asp, line 6
Her er koden.
<%
dim strfilearr, strcountfiles, randomfile, directory, allfiles, directoryfile
strmappe = "mosstock"
Set directory=server.createobject("scripting.filesystemobject")
Set allfiles=directory.getfolder(server.mappath(strmappe))
For each directoryfile in allfiles.files
strfilearr = strfilearr + directoryfile.Name & ","
strcountfiles = strcountfiles + 1
Next
if request.querystring("execute") ="popup" then
ImageArray = split(strfilearr,",")
response.write "<html>" & vbCrLf &_
"<head>" & vbCrLf &_
"<title>image gallery</title>" & vbCrLf &_
"<script>" & vbCrLf &_
"function resizeMe(){" & vbCrLf &_
"if (navigator.appName == 'Netscape'){" & vbCrLf &_
"adjWidth = document.images[""0""].width - 56;" & vbCrLf &_
"adjHeight = document.images[""0""].height - 27;" & vbCrLf &_
"}" & vbCrLf &_
"else {" & vbCrLf &_
"adjWidth = document.images[""0""].width + 100;" & vbCrLf &_
"adjHeight = document.images[""0""].height + 150;" & vbCrLf &_
"}" & vbCrLf &_
"window.resizeTo(adjWidth, adjHeight);" & vbCrLf &_
"window.focus()" & vbCrLf &_
"}" & vbCrLf &_
"</script>" & vbCrLf &_
"</head>" & vbCrLf &_
"<body margin='0' onLoad=""resizeMe();"">" & vbCrLf &_
"<table style='width:100%;height:100%;'>" & vbCrLf &_
"<tr>" & vbCrLf &_
"<td style='width:100%;height:100%;vertical-align:middle;text-align:center;'>" & vbCrLf &_
"<img src='"&strmappe&"/"&ImageArray(request.querystring("id")-1)&"' name=""0"" id='0' border='0'>" & vbCrLf &_
"</td>" & vbCrLf &_
"</tr>" & vbCrLf &_
"<tr>" & vbCrLf &_
"<td style='text-align:center;'><a href='java script:window.close();'>-= Luk =-</a></td>" & vbCrLf &_
"</tr>" & vbCrLf &_
"</table>" & vbCrLf &_
"</body>" & vbCrLf &_
"</html>" & vbCrLf
else
response.write "<html>" & vbCrLf &_
"<head>" & vbCrLf &_
"<title>image gallery</title>" & vbCrLf &_
"<SCRIPT LANGUAGE=""Javascript"" type=""text/javascript"">" & vbCrLf &_
"<!--" & vbCrLf &_
"function Popit(url) {" & vbCrLf &_
" popupWin = window.open(url,'new_page','width=350,height=250,scrollbars=yes')" & vbCrLf &_
"}" & vbCrLf &_
"//-->" & vbCrLf &_
"</SCRIPT>" & vbCrLf &_
"</head>" & vbCrLf &_
"<body style='text-align:center;'>" & vbCrLf
Dim CurrentPage, CountPages, ItemsprPage, ItemsTotal, ImageArray, StartImg, EndImg, SiteName, CountImgPrint
SiteName = request.servervariables("script_name")
ItemsTotal = strcountfiles
ItemsprPage = "15"
CurrentPage = request.querystring("id")
If CurrentPage = "" or CurrentPage = "0" then CurrentPage = "1"
CountPages = (ItemsTotal/ItemsprPage)
if CountPages > int(CountPages) then CountPages = int(CountPages) + 1
ImageArray = split(strfilearr,",")
StartImg = ((CurrentPage-1)*(ItemsprPage))
If StartImg = "0" then StartImg = "1"
EndImg = (ItemsTotal-StartImg)
if cint(EndImg) > cint(ItemsprPage) then
EndImg = round(StartImg-1) + round(ItemsprPage)
else
EndImg = (StartImg + EndImg)
End if
response.write "<table style='width:50%;'>"
CountImgPrint = 0
For I = StartImg to EndImg
CountImgPrint = CountImgPrint +1
If CountImgPrint = 1 then response.write "<tr>" & vbCrLf & vbCrLf
response.write "<td style='width:20%;text-align:center;'><a href=""java script: Popit('"&SiteName&"?execute=popup&id="&I&"')"" onfocus='blur()'><img src='"&strmappe&"/"&ImageArray(I-1)&"' border='0' style='width:41px;;height:41px;' /></a></td>" & vbCrLf
If CountImgPrint = 5 then
response.write "</tr>" & vbCrLf & vbCrLf
CountImgPrint = 0
end if
Next
response.write "</tr>" & vbCrLf &_
"<tr>" & vbCrLf &_
"<td colspan='5' style='width:100%;text-align:center;'>" & vbCrLf
For I = 1 to CountPages
If NOT Cint(CurrentPage) = Cint(I) then
response.write "<a href='"&SiteName&"?id="&I&"'>" &I& "</a>"& vbCrLf
else
response.write "["&I&"]"
end if
Next
response.write "</td>" & vbCrLf &_
"</tr>" & vbCrLf &_
"</table>" & vbCrLf &_
"</body>" & vbCrLf &_
"</html>" & vbCrLf
end if
%>
