private void btnStartAttack_Click(object sender, EventArgs e) { Func.Log("StartAutoAttack"); try { if (txtDtStr.Text.Trim() == "") { if (DialogResult.No == MessageBox.Show("你没有填写答题账号,无法自动答题,是否继续?", "提示", MessageBoxButtons.YesNo)) { return; } } else { Regedit.SetAppRegKeyValue(RegistryDirName, "eyouMiMa", txtDtStr.Text.Trim()); } worker = new Thread(new ThreadStart(AttackThread)); worker.Start(); this.Invoke(DelegateSetControl, new object[] { gbSetting, false }); this.Invoke(DelegateSetControl, new object[] { gbStart, false }); } catch (Exception ex) { MessageBox.Show(ex.Message); } this.Text = "打怪"; }
private void btnOK_Click(object sender, EventArgs e) { string regCode = txtRegCode.Text.Trim(); string mCode = this.txtMCode.Text.Trim(); if (string.IsNullOrEmpty(regCode)) { MessageBox.Show("请输入注册码!"); return; } if (HardwareInfo.CheckCode(mCode, regCode, Form1.GameName)) { Regedit.SetAppRegKeyValue(Form1.RegistryDirName, "RegCode", regCode); this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("无效注册码!"); txtRegCode.Text = ""; txtRegCode.Focus(); return; } }