<% if id=4 or id=3 then%>
<%end if%>
<%
UploadDir=upfile
if UploadDir="" then errinfo("路徑錯誤a")
TruePath=Server.MapPath(UploadDir)
set fso=CreateObject("Scripting.FileSystemObject")
If not(fso.FolderExists(TruePath)) Then errinfo("路徑錯誤")
TotleSize=0
pageUrl="?id="&id&"&" '設置鏈結網頁
pagenum=12
FCount=0
c=0
Set theFolder=fso.GetFolder(TruePath)
For Each theFile In theFolder.Files
FileCount=FileCount+1
TotleSize=TotleSize+theFile.Size
Next
if (FileCount mod pagenum)=0 then
pages= FileCount \ pagenum
else
pages= FileCount \ pagenum + 1
end if
if page=0 then page=1
if page > pages then page=pages
For Each theFile In theFolder.Files
c=c+1
if FCount>=pagenum then
exit for
elseif c>pagenum*(page-1) then
houzhui=mid(theFile.Name, InStrRev(theFile.Name, ".") + 1)
if houzhui="jpg" or houzhui="gif" or houzhui="png" then
if c mod 3 >0 then
response.write("- ")
else
response.write("
- ")
end if
%>
<%
end if
FCount=FCount+1
end if
Next
%>
<% if id=4 or id=3 then%>
<%else
call showpage(pages,page,pageUrl)
end if%>