Ejemplo n.º 1
0
 public bool SaveWq(WqtabModel wq)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("INSERT INTO wqtab(");
     strSql.Append("idwqtab,type,url,status,addtime,game)");
     strSql.Append(" VALUES (");
     strSql.Append("@idwqtab,@type,@url,@status,@addtime,@game)");
     MySqlParameter[] cmdParms = new MySqlParameter[] { new MySqlParameter("@idwqtab", wq.idwqtab), new MySqlParameter("@type", wq.type), new MySqlParameter("@url", wq.url), new MySqlParameter("@status", wq.status), new MySqlParameter("@addtime", wq.addtime), new MySqlParameter("@game", wq.game) };
     return (MySqlHelper.ExecuteNonQuery(ConstValues.connStr, strSql.ToString(), cmdParms) == 1);
 }
Ejemplo n.º 2
0
 private void viewWQ(string viewUrl, string newIP)
 {
     if (viewUrl == null || viewUrl.Equals(""))
     {
         return;
     }
     viewUrl = Regex.Replace(viewUrl, @"(\d+\.\d+\.\d+\.\d+)", newIP);
     string viewRtn = this.getAdJson(viewUrl);
     WqtabModel wq = new WqtabModel();
     wq.url = viewUrl;
     wq.game = this.gameInfo.Pnam;
     wq.type = "view";
     wq.status = viewRtn.Contains("ok") ? "ok" : "ng";
     wq.addtime = DateTime.Now;
     new WqtabBll().SaveWq(wq);
 }
Ejemplo n.º 3
0
        private void clickWQ(List<string> clickUrlList, string newIP)
        {
            if (clickUrlList == null || clickUrlList.Count == 0) return;

            Random clickRandom = new Random();
            int clickIndex = clickRandom.Next(clickUrlList.Count);
            string clickUrl = clickUrlList[clickIndex];
            clickUrl = Regex.Replace(clickUrl, @"(\d+\.\d+\.\d+\.\d+)", newIP);
            string clickRtn = this.getAdJson(clickUrl);
            WqtabModel wq = new WqtabModel();
            wq.url = clickUrl;
            wq.type = "click";
            wq.game = this.gameInfo.Pnam;
            wq.status = clickRtn.Contains("ok") ? "ok" : "ng";
            wq.addtime = DateTime.Now;
            WqtabBll bll = new WqtabBll();
            bll.SaveWq(wq);
            if (clickRandom.Next(4) == 1)
            {
                Thread.Sleep(clickRandom.Next(3000, 6000));
                int secondIndex = 0;
                if (clickIndex == 0)
                {
                    secondIndex = clickIndex + 1;
                }
                else
                {
                    secondIndex = clickIndex - 1;
                }
                clickUrl = clickUrlList[secondIndex];
                clickUrl = Regex.Replace(clickUrl, @"(\d+\.\d+\.\d+\.\d+)", newIP);
                clickRtn = this.getAdJson(clickUrl);
                wq.url = clickUrl;
                wq.type = "click";
                wq.game = this.gameInfo.Pnam;
                wq.status = clickRtn.Contains("ok") ? "ok" : "ng";
                wq.addtime = DateTime.Now;
                bll.SaveWq(wq);
            }
        }