public string CountNewsPageView(HttpContext context) { string chn = string.IsNullOrEmpty(context.Request.QueryString["chn"]) ? "" : De(context.Request.QueryString["chn"]); string share = string.IsNullOrEmpty(context.Request.QueryString["share"]) ? "" : De(context.Request.QueryString["share"]); string browse = string.IsNullOrEmpty(context.Request.QueryString["browse"]) ? "" : De(context.Request.QueryString["browse"]); string token = string.IsNullOrEmpty(context.Request.QueryString["token"]) ? "" : De(context.Request.QueryString["token"]); string sharetype = string.IsNullOrEmpty(context.Request.QueryString["sharetype"]) ? "" : De(context.Request.QueryString["sharetype"]); string e = string.IsNullOrEmpty(context.Request.QueryString["e"]) ? "" : De(context.Request.QueryString["e"]); string w = string.IsNullOrEmpty(context.Request.QueryString["w"]) ? "" : De(context.Request.QueryString["w"]); Utils.LogEntity log = new Utils.LogEntity() { LogContent = "发现频道页面浏览,浏览人[" + browse + "],分享人[" + share + "],token[" + token + "],分享方式[" + sharetype + "],浏览路径[" + context.Request.RawUrl + "],进入途径ID[" + w + "]", LogTypeID = 12, LogTime = DateTime.Now, UnqiueID = Guid.NewGuid(), ExInfo = "ip:" + context.Request.UserHostAddress + ",agent:" + context.Request.UserAgent, LogMeta = token }; int tmpUserid = 0; if (!string.IsNullOrEmpty(chn)) { int.TryParse(chn, out tmpUserid); log.UserID = tmpUserid; log.LogTitle = "发现频道页面浏览[" + e + "],chn:" + chn; } else if (!string.IsNullOrEmpty(share)) { int.TryParse(share, out tmpUserid); log.UserID = tmpUserid; log.LogTitle = "发现频道页面浏览[" + e + "],share:" + share; } else if (!string.IsNullOrEmpty(browse)) { int.TryParse(browse, out tmpUserid); log.UserID = tmpUserid; log.LogTitle = "发现频道页面浏览[" + e + "],browse:" + browse; } else { log.UserID = 0; log.LogTitle = "下载页面浏览[" + e + "],customer"; } log.LogTitle += "[进入途径ID:" + w + "]"; Utils.LogUtil.WriteLog(log); return(string.Empty); }
protected void btn_test_Click(object sender, EventArgs e) { Utils.LogEntity log = new Utils.LogEntity() { UserID = 1, LogTitle = "测试日志", LogContent = "测试日志内容信息", LogTime = DateTime.Now, LogTypeID = 1, UnqiueID = Guid.NewGuid(), ExInfo = Request.UserHostAddress, LogMeta = Request.UserAgent }; Utils.LogUtil.WriteLog(log); }
public string LogTroublePageInfo(HttpContext context) { Utils.LogEntity log = new Utils.LogEntity() { LogContent = "异常页面,请求路径" + context.Request.RawUrl + "[" + context.Request.QueryString["path"] + "]", LogTypeID = 0, LogTime = DateTime.Now, UnqiueID = Guid.NewGuid(), ExInfo = "ip:" + context.Request.UserHostAddress + ",agent:" + context.Request.UserAgent, LogMeta = "", LogTitle = "异常页面", UserID = 0 }; Utils.LogUtil.WriteLog(log); return(string.Empty); }
public string CountDownloadPageView(HttpContext context) { string chn = string.IsNullOrEmpty(context.Request.QueryString["chn"]) ? "" : De(context.Request.QueryString["chn"]); string share = string.IsNullOrEmpty(context.Request.QueryString["share"]) ? "" : De(context.Request.QueryString["share"]); string token = string.IsNullOrEmpty(context.Request.QueryString["token"]) ? "" : De(context.Request.QueryString["token"]); Utils.LogEntity log = new Utils.LogEntity() { LogContent = "下载页面浏览,下载浏览路径" + context.Request.RawUrl, LogTime = DateTime.Now, UnqiueID = Guid.NewGuid(), ExInfo = "ip:" + context.Request.UserHostAddress + ",agent:" + context.Request.UserAgent, LogMeta = token }; if (!string.IsNullOrEmpty(chn)) { log.LogTypeID = 9; log.UserID = 0; log.LogTitle = "下载页面浏览,chn:" + chn; } else if (!string.IsNullOrEmpty(share)) { log.LogTypeID = 10; log.UserID = 0; log.LogTitle = "下载页面浏览,share:" + share; } else { log.LogTypeID = 2; log.UserID = 0; log.LogTitle = "下载页面浏览,customer"; } Utils.LogUtil.WriteLog(log); return(string.Empty); }
public void Execute(IJobExecutionContext context) { BCtrl_WordCheck wcBll = new BCtrl_WordCheck(); List <string> wordList = wcBll.GetWordStringList(); if (wordList != null) { //获取需要检测的内容 BCtrl_Comment bll = new BCtrl_Comment(); try { //构建两个table 一个成功,一个失败 //利用sqlbukcopy入库,然后执行批量更新数据 DataTable returnTable = new Common().GetDataTable(); SqlDataReader reader = bll.GetWillCheckCommentReader(); while (reader.Read()) { DataRow drn = returnTable.NewRow(); drn["ID"] = int.Parse(reader["ID"].ToString()); drn["ContentType"] = int.Parse(reader["ContentType"].ToString()); string ws = ""; foreach (string word in wordList) { if (reader["Content"].ToString().Contains(word)) { ws += word + ","; } } ws = ws.TrimEnd(','); if (string.IsNullOrEmpty(ws)) { drn["CheckTypeID"] = 1; } else { drn["CheckTypeID"] = -1; } drn["WordsInfo"] = ws; returnTable.Rows.Add(drn); } reader.Close(); bll.WriteBack(returnTable); } catch (Exception ex) { Utils.LogEntity log = new Utils.LogEntity() { LogContent = ex.Message, LogMeta = "", ExInfo = "", LogTime = DateTime.Now, LogTitle = "敏感词检测异常", LogTypeID = 5, UnqiueID = new Guid(), UserID = 0 }; Utils.LogUtil.WriteLog(log); } } }