⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 conn.asp

📁 一般的,简单的的的的的的的的饿的饿恶毒 一般的,简单的的的的的的的的饿的饿恶毒 一般的,简单的的 的的 饿的饿恶毒
💻 ASP
字号:
<%
dim conn,sqlstr,DBPath
DBPath = Server.MapPath("date/pp.mdb")
connstr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="& DBPath
Set conn = Server.CreateObject("ADODB.Connection")
conn.open Connstr
session.timeout=60
''''''''''''''''''''''''''计算当前时间
times=now()
timesnian=Clng(year(times))
timesyue=Clng(month(times))+timesnian+12
timesri=Clng(day(times))+timesyue*30
timesshi=Clng(hour(times))+timesri*24
timesfen=Clng(minute(times))+timesshi*60
times=Cstr(Clng(second(times))+timesfen*60)
if session("username")="" then
sql="select * from statistics where id=1"
set Rs=Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
rs.update
rs("total")=rs("total")+1
rs.update
rs.close
session("username")="游客"
session("userrank")="0"
'''''''''''''''''''''获得 用户 ip 地址
IP=Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
if IP="" Then
IP=Request.ServerVariables("REMOTE_ADDR") 
end if
'''''''''''''''''''''生成随机数
Randomize
Rnd1=rnd()*100
Randomize
Rnd2=rnd()*100
Randomize
Rnd3=rnd()*100
Randomize
Rnd4=rnd()*100
Onlyid=Cstr(int(Rnd1)*int(Rnd2)+int(Rnd3)-int(Rnd4)+7758)&"|"&IP
'''''''''''''''''''''''''''生成onlineid的sess
Session("OnlyID")=Onlyid
session("Rank")=0
''''''''''''''''''''''''''''将结果写入数据库
conn.execute "insert into OnLine values('"&Onlyid&"','游客',"&times&","&times&",0,'"&IP&"','"&Now()&"')"

else
'''''''''''''''''''''''''''更新数据库内容
conn.execute "update OnLine set hdtime="&times&" where onlyid='"&session("Onlyid")&"'"
end if
'''''''''''''''''''''''''''删除已经超时的用户
conn.execute("delete from(online) where hdtime<'"&times&"'-3600")
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -