Exemplo n.º 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]);
         }
     }
 }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
        private void GetSource()
        {
            XmlDocument xmlDocument = new XmlDocument();

            if (File.Exists("XMLConfig.xml"))
            {
                xmlDocument.Load("XMLConfig.xml");
            }
            listGroup = new List <string>();
            dicGroup  = new Dictionary <string, string>();
            if (string.IsNullOrEmpty(cQQ))
            {
                return;
            }
            XmlNode xmlNode = xmlDocument.SelectSingleNode("Root");

            if (xmlNode == null)
            {
                return;
            }
            XmlNode xmlQQ = xmlNode.SelectSingleNode(cQQ);

            if (xmlQQ == null)
            {
                return;
            }
            var qqgroups = xmlQQ.SelectNodes("QQGroup");

            foreach (XmlNode node in qqgroups)
            {
                var    ats       = node.Attributes;
                string groupNum  = ats.GetNamedItem("GroupNum").Value.ToString();
                string groupName = ats.GetNamedItem("GroupName").Value.ToString();
                dicGroup.Add(groupName, groupNum);
                listGroup.Add(groupName);
            }
            dgvGroup.DataSource = HelperAction.getModelList(listGroup);
        }
Exemplo n.º 4
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]);
                }
            }
        }
Exemplo n.º 5
0
 private void SetDate()
 {
     dgvQQ.DataSource    = HelperAction.getModelList(listQQ);
     dgvNewQQ.DataSource = HelperAction.getModelList(listNewQQ);
 }
Exemplo n.º 6
0
 private void BtnGetGroup_Click(object sender, EventArgs e)
 {
     HelperAction.GetGroup(out listGroup, out dicGroup, webBrowser1);
     dgvGroup.DataSource = HelperAction.getModelList(listGroup);
 }
Exemplo n.º 7
0
 private void getCreateQQ(object sender, EventArgs e)
 {
     cQQ = HelperAction.getCreateQQ(webBrowser1);
 }