Пример #1
0
 //开始说话
 private void CommentFriend()
 {
     try
     {
         commentTag = getCommented();
         if (commentTag != null)
         {
             if (commentStep1(commentTag))
             {
                 if (commentStep2(commentTag))
                 {
                     if (commentStep3ex(commentTag))
                     {
                         curstepidx = 2;
                     }
                 }
             }
         }
         else
         {
             curstepidx = 999;
             LogFileEx.LogRow row = new LogFileEx.LogRow();
             row.add(curQQ);
             row.add("失败:没有可评论的位置获取无法访问空间");
             LogFileEx.add("Comment.txt", row);
             father.updateFailText(false);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("*********************************************************");
         Console.WriteLine(ex.ToString());
         Console.WriteLine("*********************************************************");
     }
 }
Пример #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            try
            {
//                 if (this.Visible)
//                     return;
                if (Environment.TickCount > alltime)
                {
                    if (!isCanDoNext)
                    {
                        if (curstepidx != 1000 && curstepidx != 999)
                        {
                            LogFileEx.LogRow row = new LogFileEx.LogRow();
                            row.add(curQQ);
                            if (curstepidx == 3)
                            {
                                row.add("失败:发送按钮不管用");
                            }
                            else
                            {
                                row.add("失败:超时了");
                            }
                            LogFileEx.add("Comment.txt", row);
                            father.updateFailText(false);
                        }
                        isCanDoNext    = true;
                        timer1.Enabled = false;
                    }
                }
                else
                {
                    if (curstepidx == 1)  // 回复
                    {
                        CommentFriend();
                    }
                    else if (curstepidx == 999)//停留10秒就隐藏了
                    {
                        //alltime = Environment.TickCount + 10000;
                        curstepidx = 1000;
                    }
                    if (curstepidx != 1000 && Environment.TickCount > alltime - 10 * 1000)//在110s的时候判断
                    {
                        bool             iscucc = isCommentedSucc();
                        LogFileEx.LogRow row    = new LogFileEx.LogRow();
                        row.add(curQQ);
                        row.add(iscucc ? "成功" : "提交失败");
                        LogFileEx.add("Comment.txt", row);
                        father.updateFailText(iscucc);
                        curstepidx = 999;
                    }
                    this.Text = cururl + " " + (alltime - Environment.TickCount).ToString();
                }
            }
            catch (Exception)
            {
            }
        }