%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
|
|
||||||||||||||||||||||||||||||||
版权所有©2005创远工作室 湘ICP备06004559号 <% '毒爱防刷新计数器 Response.Expires=-1 dim conn,connstr,rs,vip,vips,vtoday,vyesterday,vtodaytime,vsaveips,vmax,vmaxtime,vdays,vdayavg set conn=Server.CreateObject("ADODB.Connection") connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("xx/bb.mdb") conn.open connstr vip="#"&Request.servervariables("REMOTE_ADDR") set rs=conn.execute("select vips,vtoday,vtodaytime,vsaveips,vmax,vmaxtime from [bb]") if rs.eof and rs.bof then sql="insert into [bb] (vips,vtoday,vyesterday,vtodaytime,vsaveips,vmax,vmaxtime,vstarttime) values(0,0,0,Date(),'#',0,Date(),Now())" conn.execute(sql) else if rs(2)=Date() then if Instr(rs(3),vip)=False then vips=rs(0)+1 vtoday=rs(1)+1 if rs(3)="#" then vsaveips=vip else vsaveips=rs(3)&vip end if conn.execute("update [bb] set vips='"&vips&"',vtoday='"&vtoday&"',vsaveips='"&vsaveips&"'") end if else vips=rs(0)+1 vtoday=1 vyesterday=rs(1) vtodaytime=Date() vsaveips=vip conn.execute("update [bb] set vips='"&vips&"',vtoday='"&vtoday&"',vyesterday='"&vyesterday&"',vtodaytime='"&vtodaytime&"',vsaveips='"&vsaveips&"'") end if if clng(rs(1))>clng(rs(4)) then vmax=rs(1) vmaxtime=Now() conn.execute("update [bb] set vmax='"&vmax&"',vmaxtime='"&vmaxtime&"'") end if end if rs.close set rs=nothing set rs=conn.execute("select vips,vtoday,vyesterday,vtodaytime,vsaveips,vmax,vmaxtime,vstarttime from [bb]") vdays=now()-cdate(rs(7)) vdayavg=rs(0)/vdays vdays=int((vdays*10^3)+0.5)/10^3 if vdays<1 then vdays="0" & vdays vdayavg=int((vdayavg*10^3)+0.5)/10^3 response.write "总访问量:"&rs(0)&" 今日访问量:"&rs(1)&" " rs.close set rs=nothing conn.close set conn=nothing %> |