asp相册

2019-04-15 16:09发布




<%
 function showpic(pic)
  response.write("
拍摄于"&pic.DateCreated&"
"&pic.name&"
")
 end function  function GetExtName(fn)
  GetExtName = lcase(Right(fn,(Len(fn)-Instr(fn,"."))))
 end function
%>
     <%
 dim objfilesys
 'dim myfolder
 dim myfolders
 dim myfile
 
 dim count
 count = 0
 
 set objfilesys=server.CreateObject("Scripting.filesystemobject")
 set myfolder=objfilesys.getfolder(Server.MapPath("./")) 
 set myfiles=myfolder.files

 %>
 <%
  dim page,sPageSize,ecount,scount
  page = (Request.QueryString("page"))
  if page = "" or not IsNumeric(page) Then page = 1   dim filecount, pagecount  '准备分页
  sPageSize = 1 '每页显示数   filecount = clng(myfiles.count)
  pagecount = clng(filecount / sPageSize)   'response.write (filecount&"---"&pagecount) ''''''''''''''''   'if page > pagecount Then page = pagecount   page = clng(page)   scount = (page-1) * sPageSize + 1
  ecount = page * sPageSize  %>  
 <%
 for each myfile in myfiles
 'SumSize =SumSize + myfile.size   fp = cstr(myfile.path)
  if GetExtName(fp) = "jpg" Then
   count = count +1
   if scount <= count and ecount >= count Then
    if ((count-1) mod 5) = 0 then
     %>
     
     <%
    end if
    %>
    
    <%
    if ((count) mod 5) = 0 then
     %>
    
     <%
    end if
   end if
  end if
 next  %>
   
 
    <%
      showpic(myfile)
      'response.write(count)
    %>
    

 

热门文章