打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
跟踪用户访问网站痕迹

用户记录表:
编号,时间,用户Ip,访问得Url

公司表:
编号,Id,siteId,Name,Mobile,Phone,Fax,Address,Introduce,Updatetime

 

添加日志:记录

导出record表

1.http://topic.csdn.net/t/20020613/10/799931.html

在global.asax中处理最方便,用户每访问一个页面都会引发global.asax中的Application_BeginRequest事件,
你可以在这个事件中通过Request.Path获得当前访问的页面的路径,还可以统计访问次数,而不用在每个页面都去统计了,
这就是asp.net的好处。

private   void   Page_Load(object   sender,   System.EventArgs   e)
{
        if(Application.Contents.Count==0)
        {
Application.Set( "Counter ",0);
        }
        Application.Set( "Counter ",System.Convert.ToInt32(Application.Contents[0].ToString())+1);
        TextBox1.Text= "你是第 "   +   Application.Contents[0].ToString()   +   "位访客 ";
}
2.Application_BeginRequest例子
http://www.dotnetperls.com/application-beginrequest


*/////////////////////////////////
     void Application_BeginRequest(Object sender, EventArgs e)
        {
            HttpContext context = HttpContext.Current;
            string oldPath = context.Request.Path.ToLower();
            if (oldPath.IndexOf("news") != -1 || oldPath.IndexOf("single") != -1)
            {
                string str1 = oldPath.Substring(1, oldPath.LastIndexOf('/') - 1);
                string str2 = oldPath.Substring(oldPath.LastIndexOf('/') + 1, oldPath.Length - str1.Length - 7);
                string newPath = oldPath.Replace(str1 + "/" + str2 + ".aspx", str1 + ".aspx?id=" + str2);
                context.RewritePath(newPath);
            }
        }

 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
博客园(.Net方向应用) - 代码阅读总结之ASP.NET StartKit TimeTracker(角色权限之捉虫笔记)
asp.net Forms表单验证 使用经验及验证流程分析
判断是否需要验证码
java 自动生成静态页面
在ASP.NET中实现页面间的参数传递
Asp.net页面之间传递参数的几种方法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服