<% tye=request("tye") imgstyle=request("style") if request("style")="" then imgstyle=1 set rs=conn.Execute("select * from counter") if rs("oto")<>date() then zzday=date()-1 application.lock conn.Execute"Update counter set counter=counter+1,today=0,oto=convert(varchar(10),getdate(),120),daynum=daynum+1,yesterday="&rs("today")&"" conn.Execute"Insert into zzday(zzday,stats) values ('"&zzday&"',"&rs("today")&")" application.unlock else application.lock if rs("top")" next for i=1 to S zzzcounter=zzzcounter&"" next zzzcounter=zzzcounter&"" set rs=nothing conn.close set conn=nothing select case tye case "view" '输出计数器图片 %> document.write('<%=zzzcounter%>'); <% case "logo" '输出LOGO %> document.write('/stat.asp target=_blank>/<%=logo%> border=0>'); <% case "num" '输出访问的具体情况 %> document.write('总共访问量:<%=counters%>,今日访问:<%=today%>,昨日访问:<%=yesterday%>'); <% case "num1" '只输出总访问量 %> document.write('<%=counters%>'); <%end select%>