附根目录下global.asa文件,不知有用否,先贴上来。前辈多指教。
<script language=vbscript runat=server>
sub application_onstart()
set m_conn =Server.CreateObject("ADODB.Connection")
m_conn.Open "provider=microsoft.jet.oledb.4.0;data source="&Server.MapPath("database/Db_uibe.mdb")
dim rs_s
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from TB_count",m_conn,1,1
application("number")=rs_s("counts")
rs_s.close
set rs_s=nothing
m_conn.close
set m_conn=nothing
application("quest")=""
end sub
sub application_onend()
set m_conn =Server.CreateObject("ADODB.Connection")
m_conn.Open "provider=microsoft.jet.oledb.4.0;data source="&Server.MapPath("database/Db_uibe.mdb")
dim rs_s
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "update TB_count set counts="&application("number"),m_conn,3,3
rs_s.close
set rs_s=nothing
m_conn.close
set m_conn=nothing
end sub
sub session_onstart()
'on error resume next
'response.Redirect("/index.asp")
application("number")=application("number")+1
set m_conn =Server.CreateObject("ADODB.Connection")
m_conn.Mode=3
m_conn.Open "provider=microsoft.jet.oledb.4.0;data source="&Server.MapPath("database/Db_uibe.mdb")
dim ip
dim come
ip=request.ServerVariables("REMOTE_ADDR")
come=now()
m_conn.execute("INSERT INTO TB_log(session_id,join_date,ip,url) VALUES (" & session.SessionID & ",'" & come & "','" & ip & "','"& request.ServerVariables("HTTP_REFERER") & "')")
m_conn.execute("update TB_count set counts="&application("number"))
m_conn.Close
set m_conn=nothing
end sub
sub session_onend()
'session("flage")=""
'application.Lock
'application("visitors")=application("visitors")-1
'application.UnLock
end sub
</script>