<%@LANGUAGE="JSCRIPT" CODEPAGE="65001"%> <% var inLBS = true; %> <% Response.Buffer=true; Session.Timeout=30; function getIP(){ var strIP=String(Request.ServerVariables("HTTP_X_FORWARDED_FOR")).replace(/[^0-9\.,]/g,""); if(strIP.length<7) strIP=String(Request.ServerVariables("REMOTE_ADDR")).replace(/[^0-9\.,]/g,""); if(strIP.indexOf(",")>7) strIP=strIP.substr(0,strIP.indexOf(",")); return strIP; } function getBrowserCap(strUA){ var arrInfo={ "name": "Unkown", "os": "Unkown"}; var idx, idxCol; var strType=""; // Clean up string strUA = strUA.toLowerCase(); strUA = strUA.replace(/^\s+/,""); strUA = strUA.replace(/\s+$/,""); strUA = strUA.replace(/\n/,""); if(strUA.length<10) return arrInfo; // Browser Check if(strUA.indexOf("mozilla")>-1) arrInfo["name"]="Mozilla"; if(strUA.indexOf("icab")>-1) arrInfo["name"]="iCab"; if(strUA.indexOf("lynx")>-1) arrInfo["name"]="Lynx"; if(strUA.indexOf("links")>-1) arrInfo["name"]="Links"; if(strUA.indexOf("elinks")>-1) arrInfo["name"]="ELinks"; if(strUA.indexOf("jbrowser")>-1) arrInfo["name"]="JBrowser"; if(strUA.indexOf("gecko")>-1){ strType="[Gecko]"; arrInfo["name"]="Mozilla"; if(strUA.indexOf("aol")>-1) arrInfo["name"]="AOL"; if(strUA.indexOf("netscape")>-1) arrInfo["name"]="Netscape"; if(strUA.indexOf("firefox")>-1) arrInfo["name"]="FireFox"; if(strUA.indexOf("chimera")>-1) arrInfo["name"]="Chimera"; if(strUA.indexOf("camino")>-1) arrInfo["name"]="Camino"; if(strUA.indexOf("galeon")>-1) arrInfo["name"]="Galeon"; if(strUA.indexOf("k-meleon")>-1) arrInfo["name"]="K-Meleon"; arrInfo["name"]+=strType; } if(strUA.indexOf("konqueror")>-1){ arrInfo["name"]="Konqueror"; } if(strUA.indexOf("bot")>-1||strUA.indexOf("crawl")>-1){ strType="[Bot/Crawler]"; arrInfo["name"]=""; if(strUA.indexOf("grub")>-1) arrInfo["name"]="Grub"; if(strUA.indexOf("googlebot")>-1) arrInfo["name"]="GoogleBot"; if(strUA.indexOf("msnbot")>-1) arrInfo["name"]="MSN Bot"; if(strUA.indexOf("slurp")>-1) arrInfo["name"]="Yahoo! Slurp"; arrInfo["name"]+=strType; } if(strUA.indexOf("wget")>-1){ arrInfo["name"]="Wget"; } if(strUA.indexOf("ask jeeves")>-1||strUA.indexOf("teoma")>-1){ arrInfo["name"]="Ask Jeeves/Teoma"; } if(strUA.indexOf("msie")>-1){ strType="[IE"; idx=strUA.indexOf("msie") ; idxCol=strUA.indexOf(";",idx) strType+= " "+strUA.substr(idx+5, idxCol-idx-5)+"]"; arrInfo["name"]="IE"; if(strUA.indexOf("msn")>-1) arrInfo["name"]="MSN"; if(strUA.indexOf("aol")>-1) arrInfo["name"]="AOL"; if(strUA.indexOf("webtv")>-1) arrInfo["name"]="WebTV"; if(strUA.indexOf("myie2")>-1) arrInfo["name"]="MyIE2"; if(strUA.indexOf("maxthon")>-1) arrInfo["name"]="Maxthon"; if(strUA.indexOf("gosurf")>-1) arrInfo["name"]="GoSurf"; if(strUA.indexOf("netcaptor")>-1) arrInfo["name"]="NetCaptor"; if(strUA.indexOf("sleipnir")>-1) arrInfo["name"]="Sleipnir"; if(strUA.indexOf("avant browser")>-1) arrInfo["name"]="AvantBrowser"; if(strUA.indexOf("greenbrowser")>-1) arrInfo["name"]="GreenBrowser"; if(strUA.indexOf("slimbrowser")>-1) arrInfo["name"]="SlimBrowser"; arrInfo["name"]+=strType; } if(strUA.indexOf("opera")>-1){ idx=strUA.indexOf("opera") ; arrInfo["name"]="Opera "+strUA.substr(idx+6, idx+9); } if(strUA.indexOf("applewebkit")>-1){ strType="[AppleWebKit]"; arrInfo["name"]=""; if(strUA.indexOf("omniweb")>-1) arrInfo["name"]="OmniWeb"; if(strUA.indexOf("safari")>-1) arrInfo["name"]="Safari"; arrInfo["name"]+=strType; } // OS Check if(strUA.indexOf("windows")>-1) arrInfo["os"]="Windows"; if(strUA.indexOf("windows ce")>-1) arrInfo["os"]="Windows CE"; if(strUA.indexOf("windows 95")>-1) arrInfo["os"]="Windows 95"; if(strUA.indexOf("win98")>-1) arrInfo["os"]="Windows 98"; if(strUA.indexOf("windows 98")>-1) arrInfo["os"]="Windows 98"; if(strUA.indexOf("windows 2000")>-1) arrInfo["os"]="Windows 2000"; if(strUA.indexOf("windows xp")>-1) arrInfo["os"]="Windows XP"; if(strUA.indexOf("windows nt")>-1){ arrInfo["os"]="Windows NT"; if(strUA.indexOf("windows nt 5.0")>-1) arrInfo["os"]="Windows 2000"; if(strUA.indexOf("windows nt 5.1")>-1) arrInfo["os"]="Windows XP"; if(strUA.indexOf("windows nt 5.2")>-1) arrInfo["os"]="Windows 2003"; } if(strUA.indexOf("x11")>-1||strUA.indexOf("unix")>-1) arrInfo["os"]="Unix"; if(strUA.indexOf("sunos")>-1||strUA.indexOf("sun os")>-1) arrInfo["os"]="SUN OS"; if(strUA.indexOf("powerpc")>-1||strUA.indexOf("ppc")>-1) arrInfo["os"]="PowerPC"; if(strUA.indexOf("macintosh")>-1) arrInfo["os"]="Mac"; if(strUA.indexOf("mac osx")>-1) arrInfo["os"]="MacOSX"; if(strUA.indexOf("freebsd")>-1) arrInfo["os"]="FreeBSD"; if(strUA.indexOf("linux")>-1) arrInfo["os"]="Linux"; if(strUA.indexOf("palmsource")>-1||strUA.indexOf("palmos")>-1) arrInfo["os"]="PalmOS"; if(strUA.indexOf("wap ")>-1) arrInfo["os"]="WAP"; return arrInfo; } var func=new lbsFunc(); var inDebug=false; // Set a flag to use debug mode var connBlog=new DBConn("count.mdb"); connBlog.open(); var strTarget=String(Request.ServerVariables("URL")).replace("\\","/"); strTarget=strTarget.substr(strTarget.lastIndexOf("/")); strTarget+="?"+Request.ServerVariables("QUERY_STRING"); strTarget=strTarget.substr(0,50); var strUA=String(Request.ServerVariables("HTTP_USER_AGENT")); var strReferer=String(Request.ServerVariables("HTTP_REFERER")).replace(/\\/g,"/"); var browserCap = getBrowserCap(strUA); // strUA is defined in _common.asp var arrInfo={"vr_ip": getIP(), "vr_browser": browserCap.name, "vr_os": browserCap.os, "vr_referer": strReferer.substr(0,250), // strReferer is defined in _common.asp "vr_target": strTarget}; connBlog.insert("[CIHO_VistorRecord]",arrInfo); var tmpA=connBlog.query("SELECT count(vr_id) as cnt FROM [CIHO_VistorRecord]"); var c = tmpA[0]["cnt"]; delete tempA; connBlog.close(); %> document.write(" 网站总访问量<%=c%>页次");