如何在ASP。净MVC 3中对访问书进行统计

  介绍

如何在ASP。净MVC 3中对访问书进行统计?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

string  guid =, Guid.NewGuid () .ToString (),,   # region 生成js    html.Append (“function  WriteCookie (cookieName, cookieValue,,到期),{“),//js写cookie    html.Append (“, var  expDate =, new 日期();“),,   html.Append (“, if (到期),{);“;   html.Append (“, expDate.setTime (expDate.getTime(), +,到期);“),,   html.Append (“, document.cookie =, cookieName  +, \“=\“, +,逃避(cookieValue), +, \“;,路径=/;=\“到期,+,expDate.toGMTString ();“),,   html.Append (“,},),,   html.Append (“, else  {“),   html.Append (“, document.cookie =, cookieName  +, \“=\“, +,逃避(cookieValue), +, \“;,路径=/;\““),,   html.Append (“,},),,   html.Append (“}”),   html.Append (“function  ReadCookie(名字),{“),//js读取cookie    html.Append (“, var  cookieValue =, \“\”;“),,   html.Append (“, var  search =, name  +, \“=\“;;“),,   html.Append (“, if  (document.cookie.length 在0),{);“;   html.Append (“, offset =, document.cookie.indexOf(搜索);“),,   html.Append (“, if  (offset  !=, 1), {);“;   html.Append (“, offset  +=, search.length;“),,   html.Append(“,最终获得=,document.cookie.indexOf(\”, \“,,抵消);“),,   html.Append (“, if (最终获得==,1)“),,   html.Append(“,最终获得=,document.cookie.length;“),,   html.Append (“, cookieValue =, unescape (document.cookie.substring(抵消,,结束),),,   html.Append (“,},),,   html.Append (“,},),,   html.Append (“, return  cookieValue;“),,   html.Append (“}”),   html.Append (“DateFormatString =,函数(datetime,格式),{);“;   html.Append (“, var  year =, datetime.getFullYear ();“),,   html.Append (“, var  month =, datetime.getMonth () + 1;“),,   html.Append (“, var  date =, datetime.getDate ();“),,   html.Append (“, var  hour =, datetime.getHours ();“),,   html.Append (“, var  minutes =, datetime.getMinutes ();“),,   html.Append (“, var  second =, datetime.getSeconds ();“),,   html.Append (“, format =, format.replace (YY/g,,年).replace (/MM/g,月).replace (/DD/g,日期).replace (/hh/g,小时).replace (/MM/g,分钟).replace (ss/g,,第二);“),,   html.Append (“, return 格式;“),,   html.AppendLine (“}”),   html.Append (“var  cookieEnabled =, (navigator.cookieEnabled), ?, true :,假;“),,//判断浏览器是否支持cookie    html.Append (“if  (typeof  navigator.cookieEnabled ==, \“未定义的\“,,,! cookieEnabled), {“),   html.Append (“, document.cookie =, \“testcookie \“;“),,   html.Append (“, cookieEnabled =, (document.cookie ==, \“testcookie \“), ?, true :,假;“),,   html.Append (“, document.cookie =, \“\”;“),,   html.Append (“}”),   html.Append (“var  firstshow;“),,   html.Append (“var  visittotal;“),,   html.Append (“var  isLogin;“),,   html.Append (“var  loginName;“),,   html.Append (“if  (cookieEnabled ==,真的),{);“;   html.Append (“, var  HBCountShowCookie =, ReadCookie (\“HBCountShowCookie \“);“),,//访客浏览器唯一ID    html.Append (“, var  HBCountVisitTotalCookie =, ReadCookie (\“HBCountVisitTotalCookie \“);“),,//访客浏览次数,   html.Append (“, var  HBClientIDCookie =, ReadCookie (\“HBClientIDCookie \“);“),,//访客上一个点击页面ID    html.Append (“, var  HBLoginNameCookie =, ReadCookie (\“HBLoginNameCookie \“);“),,//记录登录的用户名,   html.Append (“, if  (HBCountShowCookie ==, \“\”), {);“;   html.Append (“, sparetime =, 1000, *, 60, *, 60, *, 24, *, 3650;“),,//有效期为一年,   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null   null

如何在ASP。净MVC 3中对访问书进行统计