<%@ CODEPAGE = "936" %> <% '================================= ' ' 阿江酷站访问统计系统 ' Ajiang info@ajiang.net ' www.ajiang.net ' ' 版权所有·抄袭挪用必究 ' '================================= %> <% '权限检查 if session.Contents("master")=false and whatcan<2 then Response.Redirect "help.asp?id=004&error=您没有查看IP统计的权限。" %> <%=countname%>-IP统计

Tips: 用鼠标点指图形柱或者网址可以看到对应的访问量。要得到某一时段的统计信息,请使用自定义统计。

<% set conn=server.createobject("adodb.connection") DBPath = Server.MapPath(connpath) conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath Set rs = Server.CreateObject("ADODB.Recordset") %>
   ∷∷∷ IP地址及访问量 ∷∷∷
<% sql="select vip,count(id) as allip from view group by vip order by count(id) DESC" rs.Open sql,conn,1,1 maxallip=0 sumallip=0 do while not rs.EOF if cint(rs("allip"))>maxallip then maxallip=cint(rs("allip")) sumallip=sumallip+cint(rs("allip")) rs.MoveNext loop '防止除数为0出错 if maxallip=0 then maxallip=1 if sumallip=0 then sumallip=1 rs.MoveFirst j=0 do while not rs.EOF theip=rs("vip") vallip=rs("allip") thelen=len(theip) if thelen =0 then theip="main.asp" svip="通过收藏或直接输入网址访问" end if if thelen <= 33 and thelen > 0 then svip=theip end if if thelen >= 34 then svip=left(theip,31) & "..." end if %> <% rs.MoveNext j=j+1 '如果记录超过40条,就退出 if j=40 then exit do loop %>
%"><%=svip%>  <%=theip%>,访问<%=vallip%>次,<%
	'计算访问量的百分数,精确到小数后1位,小于零的在前面加字母0
	lsbf=int(vallip*1000/sumallip)/10
	if lsbf<1 then lsbf=%"> <%=vallip%>
<% rs.Close set rs=nothing conn.Close set conn=nothing %>
<% '计算指定日期的访问量 function vdaycon(theday) theday=cdate(theday) thetday=cdate(theday+1) tmprs=conn.execute("Select count(id) as vdaycon from view where" & _ " vtime>=datevalue('" & theday & "') and vtime<=datevalue('" & thetday & "')") vdaycon=tmprs("vdaycon") if isnull(vdaycon) then vdaycon=0 end function %>