📄 conn2.asp
字号:
<%
on error resume next
dim conn
dim dbpath
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("../school/school.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
Function getmsgnum(username)
Dim re,Int_num
set re=Conn.execute("Select Count(*) from mail where towho='"&username&"' and isread=0")
Int_num=re(0)
getmsgnum=Int_num
re.close
set re=nothing
End Function
Const const_UserOnlineTimeOut=1200
dim wzip
if session("wzname")="" then
if session("wzip")="" then
session("wzip")=getuserip
end if
wzip=Session("wzip")
set rs=conn.execute ("select * from online where ip='"&wzip&"'")
if not rs.eof then
conn.execute ("update online set newtime='"&now()&"' where ip='"&wzip&"'")
else
conn.execute ("insert into online(ip,sname,entertime,newtime) values ('"&wzip&"',null,'"&now()&"','"&now()&"')")
end if
rs.close
set rs=nothing
else
wzip=Session("wzip")
set rs=conn.execute ("select * from online where ip='"&wzip&"' and sname='"&Session("wzname")&"'")
if not rs.eof then
conn.execute ("update online set newtime='"&now()&"' where ip='"&wzip&"'")
else
conn.execute ("update online set newtime='"&now()&"',sname='"&Session("wzname")&"' where ip='"&wzip&"'")
end if
rs.close
set rs=nothing
end if
conn.execute ("delete from online where datediff('s',newtime,now())>"&const_UserOnlineTimeOut)
function getuserip
dim tempuserip
Randomize
tempuserip=Request.ServerVariables("Remote_host")
tempuserip=tempuserip&":"&Fix(Rnd*10000)
getuserip=tempuserip
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -