Esempio n. 1
0
        public FindQQResponse SaveFindQQ(string findQQResponseJson)
        {
            try
            {
                FindQQResponse find = findQQResponseJson.ConvertObject <FindQQResponse>();
                List <FindQQ>  qqs  = find.result.buddy.info_list;
                new DataFromManage().SaveQQData(qqs);

                return(find);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Esempio n. 2
0
        private void QuartzForeachPage(object data)
        {
            if (this.InvokeRequired)
            {//是否通过其他形式调用
                DelegateData.BaseDelegate bd = new DelegateData.BaseDelegate(QuartzForeachPage);
                this.Invoke(bd, data);
                return;
            }
            QueryQQParam param = GetBaseQueryParam();
            int          page  = currentIndex + 1;

            param.page = page;
            QQDataDA da = new QQDataDA();

            da.QueryParam = param;
            PickUpQQDoResponse response = da.QueryQQData(Cookie);

            if (response == null)
            {
                rtbTip.Text = "No Cookie";
                return;
            }
            FindQQResponse resp = response.responseData;

            if (resp != null && resp.retcode == 0 && resp.result.buddy.totalnum > param.num)
            {
                txtPageIndex.Text = (page + 1).ToString();
            }
            else
            {
                page = 1;
                txtPageIndex.Text = page.ToString();
            }
            QueryResponseAction(response);
            if (!SystemConfig.OpenAutoQuertyDBTotal)
            {
                SyncUinStatics();
            }
        }
Esempio n. 3
0
 private void QueryResponseAction(PickUpQQDoResponse res)
 {
     executeNum++;//当前执行次数
     //  GetContainerKeyOfCookie(res.cookie);//查询qq群组数据[qq群数据提取参数待确定]
     if (res != null && res.responseData != null)
     {
         FindQQResponse qqres = res.responseData;
         StringBuilder  sb    = new StringBuilder();
         sb.AppendLine("code\t" + qqres.retcode);
         sb.AppendLine("DB Total\t" + qqres.result.buddy.totalnum);
         sb.AppendLine("now count\t" + qqres.result.buddy.info_list.Count);//info_list 可能出现为null的情况
         rtbTip.Text = sb.ToString();
         if (qqres.retcode == QQRetCode.Normal.GetHashCode() && qqres.result.buddy.info_list.Count > 0)
         {
             return;
         }
         else if (qqres.retcode == QQRetCode.Normal.GetHashCode())
         {//数据读取正常(但是当前没有查找到数据)
             //数据读取正常也可能出现腾讯没有提供返回数据(腾讯在进行防作弊检测)
             ProtectJob();
             return;
         }
         if (qqres.retcode == QQRetCode.CookieTimeOut.GetHashCode())
         { //该账户已退出登录
             rtbTip.Text = "该账户已退出";
             job.DeleteJob <JobDelegateFunction>();
             job.DeleteJob <JobAction <QQDataDA> >();
             return;
         }
         if (qqres.retcode != QQRetCode.Forbin.GetHashCode())
         {//延迟轮询的间隔
             //更改轮询条件
             ProtectJob();
         }
         else if (qqres.retcode == QQRetCode.Forbin.GetHashCode())
         {//已被腾讯封号【禁用时进行程序关闭,并反馈到邮箱】
             job.DeleteJob <JobDelegateFunction>();
             job.DeleteJob <JobAction <QQDataDA> >();
             rtbTip.Text = "该账户本次检测被禁用";
             DataLink      dl  = new DataLink();
             StringBuilder tip = new StringBuilder();
             tip.AppendLine("time:\t" + DateTime.Now.ToString(SystemConfig.DateTimeFormat));
             tip.AppendLine("App:\tCaptureWebData");
             tip.AppendLine("App Event:Pick up uin data [warm]");
             tip.AppendLine("account:\t" + Uin);
             string subject = string.Format(ConfigurationItems.ErrorSubjetFormat, " Uin" + DateTime.Now.ToString(CommonFormat.DateIntFormat));
             dl.SendDataToOtherPlatform(subject, tip.ToString());//需要知道当前在进行采集的账户
         }
     }
     else
     {
         //返回消息转换为实体对象
         FindQQResponse find = res.responseJson.ConvertObject <FindQQResponse>();
         if (find == null && res.responseJson.Contains(SystemConfig.IIS501))
         {
             rtbTip.Text = SystemConfig.IIS501;
             // Application.ExitThread();
         }
         else if (find.retcode != QQRetCode.Forbin.GetHashCode() && find.retcode != QQRetCode.CookieTimeOut.GetHashCode())
         { //错误不是来自于账户不禁用
             ProtectJob();
             return;
         }
         else
         {
             //判断返回数据的情况
             rtbTip.Text = "Error\r\n" + res.responseJson;
         }
         //一旦出现数据异常(防止被腾讯检测导致封号),停止轮询
         job.DeleteJob <JobDelegateFunction>();
         job.DeleteJob <JobAction <QQDataDA> >();
     }
     if (executeNum % SystemConfig.DivideNum == 0)
     {//满足发送邮件的条件
         DataLink      dl  = new DataLink();
         StringBuilder tip = new StringBuilder();
         tip.AppendLine("time:\t" + DateTime.Now.ToString(SystemConfig.DateTimeFormat));
         tip.AppendLine("App:\tCaptureWebData");
         tip.AppendLine("App Event:Pick up uin data [excute num]" + executeNum);
         tip.AppendLine("account:\t" + Uin);
         string subject = string.Format(ConfigurationItems.ErrorSubjetFormat, " Uin" + DateTime.Now.ToString(CommonFormat.DateIntFormat));
         dl.SendDataToOtherPlatform(subject, tip.ToString());//需要知道当前在进行采集的账户
     }
 }