?? conn.asp
字號(hào):
<%
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
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -