以下一段global.asa 的代码,我无法得 session_Onend 事件,请您指教
系统:win98/pws/
<script language=vbscript runat=server>
sub Application_OnStart
dim fsys
dim counterfilename
dim txtf
set fsys=server.CreateObject("scripting.filesystemobject")
counterfilename=server.MapPath("counter.txt")
if not fsys.FileExists(counterfilename) then
set txtf=fsys.CreateTextFile(counterfilename)
txtf.writeline "1"
txtf.close
set txtf=nothing
end if
set txtf=fsys.OpenTextFile(counterfilename,1)
application("visitornum")=txtf.readline
txtf.close
set txtf=nothing
set fsys=nothing
application.Lock
application("todayvisitor")=0
application("numonline")=0
application.UnLock
end sub
sub Application_OnEnd
dim fsys
dim counterfilename
dim txtf
set fsys=server.CreateObject("scripting.filesystemobject")
counterfilename=server.MapPath("counter.txt")
set txtf=fsys.OpenTextFile(counterfilename,2)
txtf.writeline application("visitornum")
txtf.close
set txtf=nothing
set fsys=nothing
end sub
sub session_onend
'存放当前站上人数的application变量-1
application.Lock
application("numonline")=application("numonline")-1
application.UnLock
txt=server.mappath("info.txt")
set fs=server.createobject("scripting.filesystemobject")
set ts=fs.opentextfile(txt,8,true)
str="-----------------session_onend-------------------------"&vbcrlf
ts.Writeline str
ts.close
set fs=nothing
end sub
sub Session_OnStart
Session("ip")=Request.ServerVariables("REMOTE_ADDR")
session("host")=Request.serverVariables("REMOTE_HOST")
session("server")=request.servervariables("SERVER_NAME")
session("referer")=request.servervariables("HTTP_REFERER")
session("starttime")=NOW()
txt=server.mappath("info.txt")
set fs=server.createobject("scripting.filesystemobject")
set ts=fs.opentextfile(txt,8,true)
str="------------------------------------------"&vbcrlf
str=str&"id:"&Session("ip")&vbcrlf
str=str&"fromaddress:"&session("server")&vbcrlf
str=str&"from:"&session("referer")&vbcrlf
str=str&"host:"&session("host")&vbcrlf
str=str&"startime:"&session("starttime")&vbcrlf
ts.Writeline str
ts.close
set fs=nothing
application.Lock
application("visitornum")=application("visitornum")+1
application("todayvisitor")=application("todayvisitor")+1
application("numonline")=application("numonline")+1
application.UnLock
session.timeout=10
end sub
</script>