private void Btn_Post_Click(object sender, EventArgs e)
 {
     if (Ckb_Txt.Checked == false)
     {
         if (Ckb_Smart.Checked == false)
         {
             if (string.IsNullOrEmpty(Txt_Content.Text.Trim()))
             {
                 MessageBox.Show("回帖内容不得为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return;
             }
             if (Txt_Content.Text.Trim().Length < 8)
             {
                 MessageBox.Show("回帖内容必须大于8个字符", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return;
             }
         }
     }
     Gbox_Params.Enabled = false;
     context             = Txt_Content.Text.Trim();
     Timer_time.Interval = int.Parse(Dup_Sec.SelectedItem.ToString()) * 1000;
     Btn_Post.Text       = "执行中...";
     Print("-------------------------");
     Print("少女祈祷中...");
     //初始化载入第一页50条fid&tid
     Function.Instance.GetParams(GetZone(), ref fid, ref tid);
     Print("-------------------------");
     Print("祈祷完毕");
     number = int.Parse(Cbb_Number.SelectedItem.ToString());
     t.Start();
     Print("-------------------------");
     Print("开始执行...");
     Timer_time.Start();
 }
 private void Timer_time_Tick(object sender, EventArgs e)
 {
     if (t.ThreadState == ThreadState.WaitSleepJoin)
     {
         //t.Resume();
         autoEvent.Set();
         Print(msg);
     }
     if (t.ThreadState == ThreadState.Stopped)
     {
         if (end)
         {
             Gbox_Params.Enabled = true;
             Btn_Post.Text       = "执行完毕";
             Btn_Post.Enabled    = false;
             Print("-------------------------");
             Print("执行完毕...");
             Timer_time.Stop();
         }
     }
 }
示例#3
0
 public Main()
 {
     InitializeComponent();
     Timer_time.Start();
 }