/// <summary> /// 获取登录验证码 /// </summary> private void GetLoginImage() { Program.mainForm.ShowMessage("正在获取验证码...", false); Thread12306.Stop(); //Program.mainForm.ChangeOtherButton(false); btnLogin.Enabled = false; btnFlushCode.Enabled = false; Bitmap v = null; do { v = _12306Class.GetLoginImage(); } while (v == null); pictureBox1.Image = v; btnLogin.Enabled = true; btnFlushCode.Enabled = true; Program.mainForm.ShowMessage("完成"); //ImageFrom.GetImageFrom.Show(v); //string str = ImageFrom.GetImageFrom.Code; //tbCode.Text = str; //tbCode.Text = imgOCR.GetCodeText(v); if (ConfigStore.isAutoWriterVerify) { UnCode UnCheckobj = new UnCode(v); string strNum = UnCheckobj.getPicnum(0); //识别图片 tbCode.Text = strNum; } }
public void button7_Click(object sender, EventArgs e) { Thread12306.Stop(); ConfigStore.yesFailedTimes = 0; if (checkedListBox1.CheckedItems.Count <= 0) { MessageBox.Show(Program.mainForm, "请乘车人员"); return; } if (checkedListBox2.CheckedItems.Count <= 0) { MessageBox.Show(Program.mainForm, "请选择列车"); return; } if (listBox2.Items.Count <= 0) { MessageBox.Show(Program.mainForm, "请选择乘车时间"); return; } if (listBox1.Items.Count <= 0) { MessageBox.Show(Program.mainForm, "请选择坐席"); return; } if (checkedListBox2.CheckedItems.Count > 1 && listBox2.Items.Count > 1) { MessageBox.Show(Program.mainForm, "选择多辆列车时,仅能选择一天乘车日期。"); return; } List <string> times = new List <string>(); object[] objs = new object[5]; objs[0] = TranTime.GetTimes(); objs[1] = checkedListBox2.CheckedItems; objs[2] = Seat.GetSeats(); objs[3] = this; objs[4] = checkedListBox1.CheckedItems; button7.Enabled = false; checkedListBox1.Enabled = false; ThreadPool.QueueUserWorkItem((m) => { bool b; do { b = Thread12306.Start(objs); Thread.Sleep(500); } while (!b); button12.Enabled = true; }); }
public void CloseSystem() { Thread12306.Stop(); XmlUtils.WriteLibarayXml(); ConfigStore.isAutoBaojing = Program.mainForm.isAutoBaojing(); ConfigStore.isAutoWriterVerify = Program.mainForm.isAutoWriterVerify(); ConfigStore.failedTimes = Program.mainForm.getFailedTimes(); ConfigStore.SaveConfig(); _88448Class.Logout(); Form1.firstExit = false; Form1.CloseApplication(); }
public void button12_Click(object sender, EventArgs e) { button12.Enabled = false; checkedListBox1.Enabled = true; Thread12306.Stop(); }