폴더에서 그림을 읽고 시간에 따라 정렬한 다음 페이지로 표시합니다
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
- <%
- fpath="pic/"
- Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
- set objfolder=objFSO.getfolder(server.mappath(fpath))
- picArr=""
- picbegin=""
- pageSize=20
- page=request("page")
- If page="" Then page=1
- picbegin=(page-1)*pageSize
- for each objfile in objfolder.files
- If picArr="" then
- picArr=objfile.name&"$"&objfile.DateLastModified
- Else
- picArrpicArr=picArr&"|"&objfile.name&"$"&objfile.DateLastModified
- End If
- next
- set objfolder=nothing
- picArr=Split(picArr,"|")
- picnum=UBound(picArr)+1
-
- Dim short
- for i=0 To UBound(picArr)
- For m=i To UBound(picArr)
- If CDate(Split(picArr(i),"$")(1))<CDate(Split(picArr(m),"$")(1)) Then
- short=picArr(i)
- picArr(i)=picArr(m)
- picArr(m)=short
- End if
- next
- next
-
- If picnum<pageSize Then
- pageCount=1
- Else
- pageCount=Int(picnum/pageSize)
- If picnum Mod pageSize >0 Then pageCountpageCount=pageCount+1
- End If
- thispageend=picbegin+pageSize -1
- If thispageend>=picnum Then thispageend=picnum-1
- img_html = ""
- For i=picbegin To thispageend
- img_htmlimg_html = img_html + "<li><a href='pic/"&Split(picArr(i),"$")(0)&"' target=_blank><img src='pic/"&Split(picArr(i),"$")(0)&"' /></a><br><span class=title>"&Split(Split(picArr(i),"$")(0),".")(0)&"</span><br><span class=date>"&Split(picArr(i),"$")(1)&"</span></li>"
- Next
- page_html = " : <font color=red><b>"&page&"</b></font> "
- For i=1 To pageCount
- page_htmlpage_html = page_html + " <a href='?page="&i&"'>"&i&"</a> "
- Next
- page_htmlpage_html = page_html + " <font color=red><b>"&pageCount&"</b></font> "
- %>
- <html>
- <head>
- <meta http-equiv="Content-Language" content="zh-cn">
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>Img</title>
- <style>
- body,td,th {
- /* */
- font-size: 16px;
- /* */
- color: #2E2E2E;
- /* */
- line-height: 20px;
- }
- a:link {
- text-decoration: none;
- color: #000000;
- }
-
- a:visited {
- text-decoration: none;
- color: #000000;
- }
- a:hover {
- color: #FF6600;
- }
- ul {margin:0; padding:0; list-style:none;}
- li {float:left; width:180px; overflow:hidden; text-align:center; margin:10px 6px 6px 6px}
- .title{ line-height:28px}
- .date {color:#666}
- li img{border:#999 1px solid; width:178px; height:133px; }
- div.page {padding:0 6px}
- div.page a{ border:1px #F90 solid; padding:0 2px}
- </style>
- </head>
-
- <body>
-
- <ul><%=img_html%></ul>
- <div style="clear: both; text-align:center; padding:0 20px"><hr /></div>
- <div class="page"><%=page_html%></div>
-
- </body>
- </html>
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Shadows: Spooktober in Answer Set ProgrammingASP can be viewed as an extension of Prolog. Pure Prolog rules are based on definite clauses, that is Horn clauses which...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.