Copyright(C)2005-2008 龙蟠网
www.lungpoon.com All Rights Reserved
服务电话:(025)84065388 84065988
<%
dsnstrcount1="DRIVER=sql server;server=127.0.0.1;database=count;uid=sa;password=njzx590826;"
set dsnstrcount=server.CreateObject("adodb.connection")
dsnstrcount.Open dsnstrcount1
%>
<%
'on error resume next
is_echo=cbool(Request.Cookies("echox")(""&request.ServerVariables("SCRIPT_NAME")&""))
if is_echo <> true then
Response.Cookies("echox")(""&request.ServerVariables("SCRIPT_NAME")&"")=true
end if
if is_echo <> true then
set rscount=server.CreateObject("adodb.recordset")
sql="select * from ccount with(updlock) where cdate='"&date&"' and colu='"&replace(request.ServerVariables("SCRIPT_NAME"),"'","''")&"'"
rscount.open sql,dsnstrcount,3,2
if not rscount.eof and not rscount.bof then
rscount("ccount")=rscount("ccount")+1
else
rscount.addnew
rscount("cdate")=date
rscount("ccount")=1
rscount("colu")=request.ServerVariables("SCRIPT_NAME")
end if
rscount.update
rscount.close
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
sql="select top 1 * from ccount1 with(updlock) where ipdate='"&date&"' and colu='"&replace(request.ServerVariables("SCRIPT_NAME"),"'","''")&"' and ip='"&userip&"'"
rscount.open sql,dsnstrcount,3,2
if rscount.eof or rscount.bof then
rscount.addnew
rscount("ipdate")=date
rscount("ip")=userip
rscount("colu")=request.ServerVariables("SCRIPT_NAME")
rscount.update
end if
rscount.close
end if
set rscount=nothing
dsnstrcount.close
set dsnstrcount=nothing
%>