取得浏览者的离开时间
类别: ASP教程
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
sub Application_OnStart
Application("conn")="dsn=;uid=;pwd="
end sub
Sub session_onstart
session("ip")=Request.ServerVariables("REMOTE_ADDR")
session("stime")=now()
application.Lock
if application("clicks")="" then
application("clicks")=0
end if
application("clicks")=application("clicks")+1
application.UnLock
End Sub
Sub Session_Onend
application.Lock
StrSQL="dsn=;uid=;pwd="
set conn=server.createobject("ADODB.CONNECTION")
conn.open StrSQL
SQL = "insert into client(c_date,stime,etime,ip) values(\'"&date()&"\',\'"&_
session("stime")&"\',\'"&now()&"\',\'"&session("ip")&"\')"
conn.Execute(sql)
conn.Close
set conn=nothing
application.UnLock
End Sub
sub Application_OnStart
Application("conn")="dsn=;uid=;pwd="
end sub
Sub session_onstart
session("ip")=Request.ServerVariables("REMOTE_ADDR")
session("stime")=now()
application.Lock
if application("clicks")="" then
application("clicks")=0
end if
application("clicks")=application("clicks")+1
application.UnLock
End Sub
Sub Session_Onend
application.Lock
StrSQL="dsn=;uid=;pwd="
set conn=server.createobject("ADODB.CONNECTION")
conn.open StrSQL
SQL = "insert into client(c_date,stime,etime,ip) values(\'"&date()&"\',\'"&_
session("stime")&"\',\'"&now()&"\',\'"&session("ip")&"\')"
conn.Execute(sql)
conn.Close
set conn=nothing
application.UnLock
End Sub
-= 资 源 教 程 =-
文 章 搜 索