Exemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            Counter = new VisiteCount();
            VisiteCount conter = AppCtx.Cache.RetrieveObject <VisiteCount>(PageVisitorHelper.VisiteCountCacheKey);

            if (conter == null)
            {
                conter = PageVisitorHelper.GetCurrentVisiteCount();
            }
            if (conter != null)
            {
                Counter.TotalPageView      = conter.TotalPageView + InitTotalPageView;
                Counter.TotalVisitors      = conter.TotalVisitors + InitTotalVisitors;
                Counter.YearVisitors       = conter.YearVisitors + InitYearVisitors;
                Counter.MonthVisitors      = conter.MonthVisitors + InitMonthVisitors;
                Counter.DayVisitors        = conter.DayVisitors + InitDayVisitors;
                Counter.YestodayVisitors   = conter.YestodayVisitors + InitYestodayVisitors;
                Counter.AverageDayVisitors = conter.AverageDayVisitors + InitAverageDayVisitors;
                Counter.YearPageview       = conter.YearPageview + InitYearPageview;
                Counter.MonthPageview      = conter.MonthPageview + InitMonthPageview;
                Counter.DayPageview        = conter.DayPageview + InitDayPageview;
                Counter.YestodayPageview   = conter.YestodayPageview + InitYestodayPageview;
                Counter.AverageDayPageview = conter.AverageDayPageview + InitAverageDayPageview;
                Counter.OnlineVisitors     = conter.OnlineVisitors + InitOnlineVisitors;
            }
        }
Exemplo n.º 2
0
        protected string GetVisitorCount()
        {
            PageVisitorHelper helper = ((HelperFactory)Application[Framework.HelperFactory.ApplicationID]).GetHelper <PageVisitorHelper>();
            VisiteCount       vc     = helper.GetCurrentVisiteCount();
            StringBuilder     sb     = new StringBuilder();

            sb.Append(@"    总访问量:" + vc.TotalVisitors + @"人次<br>
                            总浏览量:" + vc.TotalPageView + @"人次<br>
                            今日访问:" + vc.DayVisitors + @"人次<br>
                            日均访问:" + vc.AverageDayVisitors + "人次<br>");
            return(sb.ToString());
        }
Exemplo n.º 3
0
        private void BindCount()
        {
            VisiteCount vc = PageVisitorHelper.GetCurrentVisiteCount();

            LabelTotalVisitors.Text = vc.TotalPageView.ToString();
            TodayPVLabel.Text       = vc.DayPageview.ToString();

            StatisticsArticle sa = PageViewReportHelper.GetStatisticsArticleCount();

            LabelTotalArticles.Text = sa.TotalArticles.ToString();
            LabelTotalComments.Text = sa.TotalComments.ToString();
            LabelMonthArticles.Text = sa.MonthArticles.ToString();
            LabelMonthComments.Text = sa.MonthComments.ToString();
            LabelWeekArticles.Text  = sa.WeekArticles.ToString();
            LabelWeekComments.Text  = sa.WeekComments.ToString();
        }