网站计数器
View Code
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 Com.Netmarch.BLL; using Com.Netmarch.Model; /// <summary> /// 网站计数器 /// </summary> public class VisitCounter { [Ajax.AjaxMethod] public static void UpdateVisitRecord(int tongji_Id, string tongji_ReferUrl, string tongji_ReferEngine, string tongji_ClientScreen, string tongji_ClientSystem, string tongji_ClientBrowser) { VisitRecord nmm_VisitRecord = new VisitRecord(); VisitRecordInfo oVisitRecordInfo = nmm_VisitRecord.GetVisitRecordInfoByID(tongji_Id); if (oVisitRecordInfo != null) { //只允许更新两分钟内的记录 if (oVisitRecordInfo.VisitTime.AddMinutes(2) >= DateTime.Now && oVisitRecordInfo.VisitIp == HttpContext.Current.Request.UserHostAddress) { oVisitRecordInfo.ReferUrl = tongji_ReferUrl; oVisitRecordInfo.ReferEngine = tongji_ReferEngine; oVisitRecordInfo.ClientScreen = tongji_ClientScreen; oVisitRecordInfo.ClientSystem = tongji_ClientSystem; oVisitRecordInfo.ClientBrowser = tongji_ClientBrowser; nmm_VisitRecord.UpdateVisitRecordByID(oVisitRecordInfo); } } } }
道之所在,虽千万人吾往矣