請問如何做一個專業的圖片計數器?
<%
countlong=8
' 定義計數器位數.
On Error Resume Next
' 忽略所有的錯誤.
count=server.mappath(count.txt)
set cou = server.createobject(scripting.filesystemobject)
set out=cou.opentextfile(count,1,false,false)
counter=out.readline
out.close
' 打開count.txt,讀出目前計數器的值.
if session(in)<>in then
' 判斷用戶是否已進入主頁,防止用戶刷新或再次來到此頁面時計數器再加1.
session(in)=in
set out = cou.createtextfile(count,true,false)
application.lock
counter=counter+1
' 計數器加1 .
out.writeline(counter)
application.unlock
out.close
' 建立新文件count.txt並寫入加1後計數器的值.
end if
co=cstr(counter)
' 把數字型變量轉換成字符型.
for i = 1 to countlong-len(co)
' 得到前面0圖片的個數.
response.write
next
' 完成計數器前面的0圖片的添加.
for i= 1 to len(co)
response.write
next
' 從變量co的第i位開始讀.
%>
[1]