页面来源统计
来源:互联网 发布:ios数据库面试题 编辑:程序博客网 时间:2024/06/07 03:11
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BLL;
/// <summary>
/// pageCount 的摘要说明
/// </summary>
public abstract class pageCount
{
public static void pageCountDo(Page page)
{
BpageCount bpage = new BpageCount();
string cookieid = "0";
if (page.Request.Cookies["countid"] != null)
{
cookieid = page.Request.Cookies["countid"].Value.ToString();
}
if (page.Request.Cookies["hSerialNo"] == null)
{
string _dt = DateTime.Now.ToString("yyyyMMdd");
Random rnd = new Random(31104000);
string str_rnd = _dt + "9" + DateTime.Now.ToString("hhm") + rnd.Next(10000, 99999).ToString();
str_rnd = str_rnd.Substring(0, 16);
page.Response.Cookies["hSerialNo"].Value = str_rnd;
page.Response.Cookies["hSerialNo"].Expires.AddMinutes(30.00);
}
string cururl = page.Request.Url.ToString();
string relurl = "";
if (page.Request.UrlReferrer != null)
{
relurl = page.Request.UrlReferrer.ToString();
page.Response.Cookies["frmurl"].Value = relurl.ToString();
page.Response.Cookies["frmurl"].Expires.AddMinutes(20.00);
}
string ip = page.Request.UserHostAddress;
string browser = page.Request.Browser.Type;
//string os = page.Request.Browser.Platform;
string os = "";
string agent = page.Request.UserAgent;
if (agent.Contains("NT 5.2"))
{
os = "Windows 2003";
}
else if (agent.Contains("NT 5.1"))
{
os = "Windows XP";
}
else if (agent.Contains("NT 5"))
{
os = "Windows 2000";
}
else if (agent.Contains("NT 4.9"))
{
os = "Windows ME";
}
else if (agent.Contains("NT 4"))
{
os = "Windows NT4";
}
else if (agent.Contains("NT 98"))
{
os = "Windows 98";
}
else if (agent.Contains("NT 95"))
{
os = "Windows 95";
}
else if (os.ToLower().Contains("Mac"))
{
os = "Mac";
}
else if (os.ToLower().Contains("unix"))
{
os = "UNIX";
}
else if (os.ToLower().Contains("linux"))
{
os = "Linux";
}
else if (os.Contains("SunOS"))
{
os = "SunOS";
}
string language = page.Request.UserLanguages[0];
string ipaddress;
IPinfo objScan = new IPinfo();
objScan.DataPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/QQWry.Dat");
objScan.IP = Convert.ToString(ip);
string addre = objScan.IPtoAdrress(Convert.ToString(ip));
string err = objScan.ErrMsg;
ipaddress = addre + err;
page.Response.Cookies["countid"].Value = bpage.pageInfoAdd(cookieid, cururl, relurl, ip, browser, os, language,ipaddress);
page.Response.Cookies["countid"].Expires.AddHours(8.0);
}
}
- 页面来源统计
- 获取来源页面的页面
- 实用SQL:访问来源统计
- 返回并刷新来源页面
- php获取来源页面地址
- 根据页面来源不同返回不同页面
- 做一个简单的访问来源统计
- 做一个简单的访问来源统计
- 关于APP安装来源统计的分析
- php的简单页面来源判断 HTTP_REFERER
- 一段JS简单获取页面来源地址
- 用户自动重定向来源页面
- 由来源地址决定显示什么页面
- js获得页面的来源地址
- C#获得来源页面的URL
- php+dbfile开发简单的访客来源统计
- \t\t最近两周访问来源统计
- iOS渠道追踪和来源统计的几种原理
- Struts2获得Session和Request对象
- 无限级联下拉菜单
- 《诗盗·咏瘤》
- javascript 正则表达式的贪婪与非贪婪
- 在Windows Server下集成Apache、Tomcat和IIS
- 页面来源统计
- flex, java, blazeds 初体验
- 将上传文件以二进制形式存入数据库中,并下载数据库中的二进制数据生成对应的文件
- 24 个漂亮的个性化 HTML 表单技术
- “360安全卫士优化后,输入法图标丢失”解决方法
- Windows 7系统Shell命令与快捷键收集汇总
- C++/Debug模式查看EFL(标志寄存器)详解
- 我的新浪博客
- 初次到来