瀏覽文件夾下面所有圖片
2024-05-04 11:02:58
供稿:網友
復制代碼 代碼如下:
<%
'+-----------------------------------+
'| 變量設置
'+-----------------------------------+
cTitle = "所有上傳圖片(注:以下為圖片文件夾下面所有圖片,并非全部為有效圖片!)" '名字
cPicType = "jpeg,jpg,gif,png,bmp" '圖片類型 (使用","將圖片格式分開)
cHeight = 120 '縮圖高度
cWidth = 120 '縮圖寬度
cEachLineMax = 5 '每行顯示圖片數
cEachPageMax = 20 '每頁顯示圖片數目
pic_path="/uploadpic/" '設定圖片所在路徑
'+-----------------------------------+
'| 定義函數
'+-----------------------------------+
Function getExt(name)
getExt = right(name, 3)
End Function
Function isPIC(fileName, picType)
ext = getExt(fileName)
isPIC = False
typeList = split(picType, ",")
For ii = LBound(typeList) To UBound(typeList)
If UCase(ext) = UCase(typeList(ii)) Then
isPIC = True
Exit For
End If
Next
End Function
Function pageBar(page, pageTotal)
response.Write "[ <A HREF="&Request.ServerVariables("SCRIPT_NAME")&"?page=" & (page - 1) & " title=上一頁>上一頁</A> ] "
response.Write "<A HREF="&Request.ServerVariables("SCRIPT_NAME")&"?page=1 title=首頁><< </A>"
i = pageStart
Do while i < page
response.Write "<A HREF="&Request.ServerVariables("SCRIPT_NAME")&"?page=" & i & " title=""第 " & i & " 頁"">[" & i & "]</A> "
i = i + 1