如何讓計(jì)數(shù)器只對(duì)新進(jìn)用戶計(jì)數(shù)?
如何讓計(jì)數(shù)器只對(duì)新進(jìn)用戶計(jì)數(shù)?
<script language=vbscript runat=server>
sub application_onstart
filepath=server.mappath("/count")
filename=filepath+"\counter.txt"
set fs=createobject("scripting.filesystemobject")
if not fs.fileexists(filename) then
fs.createtextfile(filename)
set f=fs.getfile(filename)
s=1
Set ts = f.OpenAsTextStream(2, -2)
ts.writeline(cstr(s))
ts.close
else
set f=fs.getfile(filename)
Set ts = f.OpenAsTextStream(1, -2)
s=ts.readline+1
ts.close
end if
application(“visitor”)=s
end sub
sub session_onstart
session.timeout=5
application("visitor ")=application("visitor ")+1
set f=fs.getfile(filename)
Set ts = f.OpenAsTextStream(2, -2)
ts.writeline (cstr(application("visitor ")))
ts.close
end sub
</script>
<%
s=cstr(application("visitor")+10^6)
s=mid(s,2,6)
for i=1 to 6
response.write "<img src='flashdays/liyanbing/images/"
&mid(s,i,1)&".gif' width='18' height='25'>"
next
%>[1]
相關(guān)文章
如何讓一個(gè)方框欄內(nèi)的文字滾動(dòng)顯示?
如何讓一個(gè)方框欄內(nèi)的文字滾動(dòng)顯示?...2006-11-11如何把Recordset轉(zhuǎn)換成彩色的XML文件
如何把Recordset轉(zhuǎn)換成彩色的XML文件...2006-11-11為什么用磁盤序列號(hào)加密過的代碼不能被復(fù)制安裝?
為什么用磁盤序列號(hào)加密過的代碼不能被復(fù)制安裝?...2006-11-11如何計(jì)算出當(dāng)前日期屬于定義時(shí)間段內(nèi)的第幾星期?
如何計(jì)算出當(dāng)前日期屬于定義時(shí)間段內(nèi)的第幾星期?...2006-11-11如何在ASP中恰當(dāng)?shù)剡\(yùn)用Cookies?
如何在ASP中恰當(dāng)?shù)剡\(yùn)用Cookies?...2006-11-11