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

📄 count.asp

📁 使用asp
💻 ASP
📖 第 1 页 / 共 2 页
字号:
conn.execute sqlmo4
else
rssqlmo.close
set rssqlmo=nothing
rssqlmo1.close
set rssqlmo1=nothing
end if


dy=Dateadd("yyyy",-1,now())'//插入年表
dyc=cstr(Datepart("yyyy",dy))
sqlyear="select * from kyear where kyear='"&dyc&"' and kyearuserid='"&overuserid&"'"
set rssqlyear=Server.createobject("adodb.recordset")
rssqlyear.open sqlyear,conn,1,1

sqlyear1="select * from kmonth where kmonthyear='"&dyc&"' and kmonthuserid='"&overuserid&"'"
set rssqlyear1=Server.createobject("adodb.recordset")
rssqlyear1.open sqlyear1,conn,1,1

if rssqlyear.eof and not rssqlyear1.eof then
rssqlyear.close
set rssqlyear=nothing
rssqlyear1.close
set rssqlyear1=nothing
dyy=year(dy)
dym=month(dy)
dyd=day(dy)
if len(dym)=1 then
dym="0"&dym
end if
if len(dyd)=1 then
dyd="0"&dyd
end if
dyt=dyy&"-"&dym&"-"&dyd

sqlyear2="select sum(kmonthcount) from kmonth where kmonthyear='"&dyc&"' and kmonthuserid='"&overuserid&"'"
set rssqlyear2=Server.createobject("adodb.recordset")
rssqlyear2.open sqlyear2,conn,1,1
kyearcount=rssqlyear2(0)
rssqlyear2.close
set rssqlyear2=nothing

sqlyear3="insert into kyear(kyearuserid,kyear,kyeardate,kyearcount) values('"&overuserid&"','"&dyc&"','"&dyt&"',"&kyearcount&")"
conn.execute sqlyear3

dydel=cstr(clng(Datepart("yyyy",dy)))
yeardel="delete from kmonth where kmonthdate<#"&dy&"# and kmonthuserid='"&overuserid&"'"
conn.execute yeardel
else
rssqlyear.close
set rssqlyear=nothing
rssqlyear1.close
set rssqlyear1=nothing
end if

ipdate=Dateadd("d",-1,now())'//一天统计一次IP浏览器等信息
ipdatem=cstr(Datepart("d",ipdate))
sqlipdate="select * from kip where kuserid='"&overuserid&"' and kmark=2 and kmarkday='"&ipdatem&"'"
set rssqlipdate=Server.createobject("adodb.recordset")
rssqlipdate.open sqlipdate,conn,1,1


sqlipdate2="select * from kip where kuserid='"&overuserid&"' and kmark=1 and kmarkday='"&ipdatem&"'"
set rssqlipdate2=Server.createobject("adodb.recordset")
rssqlipdate2.open sqlipdate2,conn,1,1


if rssqlipdate.eof and not rssqlipdate2.eof then
rssqlipdate.close
set rssqlipdate=nothing
rssqlipdate2.close
set rssqlipdate2=nothing

sqlip="select count(*) from kip where kuserid='"&overuserid&"' and ktime<#"&ipdate&"# and kexp like 'IE5%' and kmark=1"
set rssqlip=Server.Createobject("adodb.recordset")
rssqlip.open sqlip,conn,1,1
if  not rssqlip.eof then
kienow=rssqlip.recordcount
kienow=rssqlip(0)
rssqlip.close
set rssqlip=nothing
else
rssqlip.close
set rssqlip=nothing
kienow=0
end if

sqlipold="select count(*) from kip where kuserid='"&overuserid&"' and ktime<#"&ipdate&"# and kexp like 'IE4%' and kmark=1 "
set rssqlipold=Server.createobject("adodb.recordset")
rssqlipold.open sqlipold,conn,1,1
if  not rssqlipold.eof then
kieold=rssqlipold(0)
rssqlipold.close
set rssqlipold=nothing
else
rssqlipold.close
set rssqlipold=nothing
kieold=0
end if
sqlsy="select count(*) from kip where kuserid='"&overuserid&"' and ktime<#"&ipdate&"# and ksys like 'WinNT%' and kmark=1"
set rssqlsy=Server.createobject("adodb.recordset")
rssqlsy.open sqlsy,conn,1,1
if not rssqlsy.eof then
kwinnow=rssqlsy(0)
rssqlsy.close
set rssqlsy=nothing
else
rssqlsy.close
set rssqlsy=nothing
kwinnow=0
end if

sqlsy2="select count(*) from kip where kuserid='"&overuserid&"' and ktime<#"&ipdate&"# and ksys like 'Win9%' and kmark=1"
set rssqlsy2=Server.createobject("adodb.recordset")
rssqlsy2.open sqlsy2,conn,1,1
if not rssqlsy2.eof then
kwinold=rssqlsy2(0)
rssqlsy2.close
set rssqlsy2=nothing
else 
rssqlsy2.close
set rssqlsy2=nothing
kwinold=0
end if

sqlipcount="select count(*) from kip where kuserid='"&overuserid&"' and  ktime<#"&ipdate&"# and kmark=1"
set rssqlipcount=Server.createobject("adodb.recordset")
rssqlipcount.open sqlipcount,conn,1,1
if  not rssqlipcount.eof then
sqlipcountnum=rssqlipcount(0)
rssqlipcount.close
set rssqlipcount=nothing
knetscape=clng(sqlipcountnum)-(clng(kienow)+clng(kieold))
kelse=clng(sqlipcountnum)-(clng(kwinnow)+clng(kwinold))
else
rssqlipcount.close
set rssqlipcount=nothing
knetscape=0
kelse=0
end if

mark="insert into kip(kuserid,kmark,kieold,kienow,knetscape,kwinold,kwinnow,kelse,ktime,kmarkday) values('"&overuserid&"',2,"&kieold&","&kienow&","&knetscape&","&kwinold&","& kwinnow&","&kelse&",#"&ipdate&"#,'"&ipdatem&"')"
conn.execute mark

sqlarea1="select * from kip where kuserid='"&overuserid&"' and kmark=1"
set rssqlarea1=Server.createobject("adodb.recordset")
rssqlarea1.open sqlarea1,conn,1,1
if not rssqlarea1.eof then'这个用户有IP值
areaarray=rssqlarea1.getrows(,,2)'//因为只取了一个字段的值所以二维数组的字段为0
rsrecordcount=rssqlarea1.recordcount'//有多少个IP记录
rssqlarea1.close
set rssqlarea1=nothing
else 
rssqlarea1.close
set rssqlarea1=nothing
end if

for i=0 to clng(rsrecordcount-1)
areaip=Trim(Replace(areaarray(0,i),".",""))
areaip1="select * from IpInfo where StartIp like '"&left(areaip,6)&"%'"'//判断前六位
set rsareaip1=Server.createobject("adodb.recordset")
rsareaip1.open areaip1,conn,1,1

if not rsareaip1.eof then'//如果前六位相等
rsarearecount1=rsareaip1.recordcount'//统计前6位相等的地区数
'------如果有其它地区
if rsarearecount1=1 then
area=rsareaip1("Area")
rsareaip1.close
set rsareaip1=nothing
elseif rsarearecount1>1 then
while not rsareaip1.eof 
afterip=mid(rsareaip1("StartIp"),6,3)'从第六位起取后三位
if afterip=mid(areaip,6,3) and clng(mid(areaip,9,3))<clng(mid(rsareaip1("EndIp"),9,3)) then'比较IP后三位
area=rsareaip1("Area")
end if
rsareaip1.movenext
wend
if area=empty then
area="无法判断"
end if
rsareaip1.close
set rsareaip1=nothing
end if
'--------
else 
rsareaip1.close
set rsareaip1=nothing
area="无法判断"
end if
set rsareanum=Server.createobject("adodb.recordset")
rsareanum.open "select * from kcountarea where countarea='"&area&"'",conn,1,1
source=rsareanum(""&overuserid&"")'找到这个地区读取这个用户名字段的值
rsareanum.close
set rsareanum=nothing
areain="update kcountarea set "&overuserid&"="&source&"+1,countareatime=#"&now()&"#  where countarea='"&area&"'"'//更新这个用户字段的对应地区的值
conn.execute areain
next



mark="delete  from kip where ktime<#"&ipdate&"# and kuserid='"&overuserid&"' and kmark=1"
conn.execute mark
else
rssqlipdate.close
set rssqlipdate=nothing
rssqlipdate2.close
set rssqlipdate2=nothing
end if

Application.unlock
else
rsoverseid.close
set rsoverseid=nothing
end if

unit=clng(len(session("newcountnumer")))'判断位数
if unit<=6 then
unita=6
else
unita=8
end if

for it=1 to unita-unit'补零
session("newcountnumer")="0"&session("newcountnumer")
next

ser= Request.ServerVariables("SERVER_NAME")'返回dns名称或IP
url= Request.ServerVariables("URL")'当前页面的虚拟路径
url=Replace(url,"count.asp","")

for i=1 to clng(len(session("newcountnumer")))
number=session("newcountnumer")
imgname=mid(number,i,1)
imgname=imgname&".gif"
pic="HTTP://"&ser&url&"images/"&session("countmanner")&"/"&imgname  
%>
document.write('<img src="<%=pic%>" border="0">')
<%
next'以上代码通过客户端的<script>不断的刷新本页面
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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