%
CountFile = Server.MapPath("DB/count.txt")
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Set Out= FileObject.OpenTextFile (CountFile, 1, FALSE, FALSE)
counter = Out.ReadLine
Out.Close
SET FileObject = Server.CreateObject("Scripting.FileSystemObject")
Set Out= FileObject.CreateTextFile (CountFile, TRUE, FALSE)
Application.lock
if not session("same")=1 then
counter= counter + 1
session("same")=1
end if
Out.WriteLine(counter)
Application.unlock
Out.Close
Length=Len(counter)
ImgStr=""
for i=1 to 7 - Length ' 計數器預設 6 位數 , 不滿以 0 補足
ImgStr1=""+ImgStr1
next
do while Length>=1 ' 將數字轉成對應的圖檔名稱
ImgStr2="
"+ImgStr2
Length=Length-1
loop
ImgStr=ImgStr1+ImgStr2
%>