Example #1
0
 private void MsgNewQQ(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(bkn))
     {
         HelperAction.getBkn(webBrowser1);
     }
     foreach (string item in dicGroup.Keys)
     {
         string        resultStr = HelperAction.Get(0, 40, dicGroup[item], webBrowser1);
         string[]      eqq       = resultStr.Split(',');
         List <string> lstr      = new List <string>();
         List <string> lsal      = new List <string>();
         List <string> lsre      = new List <string>();
         if (diclistMsg.ContainsKey(dicGroup[item]))
         {
             lstr = diclistMsg[dicGroup[item]];
         }
         else
         {
             diclistMsg.Add(dicGroup[item], lstr);
         }
         foreach (string qq in eqq)
         {
             if (string.IsNullOrEmpty(qq))
             {
                 continue;
             }
             lsal.Add(qq);
             if (!lstr.Contains(qq))
             {
                 lstr.Add(qq);
                 if (isFirstMsg.Contains(dicGroup[item]))
                 {
                     MessageBox.Show("群:" + item + " 用户:" + qq + "新增!");
                 }
             }
         }
         foreach (string num in lstr)
         {
             if (!lsal.Contains(num))
             {
                 lsre.Add(num);
             }
         }
         foreach (string num in lsre)
         {
             lstr.Remove(num);
         }
         if (!isFirstMsg.Contains(dicGroup[item]))
         {
             isFirstMsg.Add(dicGroup[item]);
         }
     }
 }
Example #2
0
        private void btn_start_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(groupNumber))
            {
                return;
            }
            //判断目标群号是否为空
            if (string.IsNullOrEmpty(groupNumber))
            {
                MessageBox.Show("QQ群号不能为空!");
                return;
            }
            string resultStr = HelperAction.Get(0, 40, groupNumber, webBrowser1);

            GetQQList(resultStr);
            SetDate();
        }
Example #3
0
        private void getNewList()
        {
            if (dbm == null)
            {
                dbm = new List <NewQQModel>();
            }

            foreach (string item in _dicGroup.Keys)
            {
                string        resultStr = HelperAction.Get(0, 40, _dicGroup[item], _webBrowser);
                string[]      eqq       = resultStr.Split(',');
                List <string> lstr      = new List <string>();
                List <string> lsal      = new List <string>();
                List <string> lsre      = new List <string>();
                if (_diclistMsg.ContainsKey(_dicGroup[item]))
                {
                    lstr = _diclistMsg[_dicGroup[item]];
                }
                else
                {
                    _diclistMsg.Add(_dicGroup[item], lstr);
                }
                foreach (string qq in eqq)
                {
                    if (string.IsNullOrEmpty(qq))
                    {
                        continue;
                    }
                    lsal.Add(qq);
                    if (!lstr.Contains(qq))
                    {
                        lstr.Add(qq);
                        if (_isFirstMsg.Contains(_dicGroup[item]))
                        {
                            var MaxNo = 0;
                            if (dbm.Count > 0)
                            {
                                dbm.Max(c => c.No);
                            }
                            NewQQModel nqm = new NewQQModel()
                            {
                                No           = MaxNo + 1,
                                GroupName    = item,
                                QQ           = qq,
                                JoinDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
                            };
                            dbm.Add(nqm);
                        }
                    }
                }
                foreach (string num in lstr)
                {
                    if (!lsal.Contains(num))
                    {
                        lsre.Add(num);
                    }
                }
                foreach (string num in lsre)
                {
                    lstr.Remove(num);
                    var ml = dbm.FirstOrDefault(c => c.QQ == num);
                    if (ml != null)
                    {
                        dbm.Remove(ml);
                    }
                }
                if (!_isFirstMsg.Contains(_dicGroup[item]))
                {
                    _isFirstMsg.Add(_dicGroup[item]);
                }
            }
        }