private void 除帐号ToolStripMenuItem_Click(object sender, EventArgs e) { 除帐号ToolStripMenuItem.Enabled = false; Task.Factory.StartNew(() => { try { int nIndex = GetSelectIndex(); if (nIndex == -1) { MessageBox.Show("至少你也要选中一行吧?"); return; } lock (Code.CGlobalVariable.g_AccountList) { API.AccountHandle(0x2, Code.CGlobalVariable.g_AccountList[nIndex].strUserName); Code.CGlobalVariable.g_AccountList.RemoveAt(nIndex); Invoke(new MethodInvoker(delegate() { lock (dgvAccount) { dgvAccount.Rows.RemoveAt(nIndex); } })); } 除帐号ToolStripMenuItem.Enabled = true; } catch (Exception ex) { MessageBox.Show("删除帐号异常:" + ex.Message); } }); }
private void 恢复挂机ToolStripMenuItem_Click(object sender, EventArgs e) { 恢复挂机ToolStripMenuItem.Enabled = false; Task.Factory.StartNew(() => { try { int nIndex = GetSelectIndex(); if (nIndex == -1) { MessageBox.Show("至少你也要选中一行吧?"); return; } lock (Code.CGlobalVariable.g_AccountList) { API.AccountHandle(0x5, Code.CGlobalVariable.g_AccountList[nIndex].strUserName); } 恢复挂机ToolStripMenuItem.Enabled = true; } catch (Exception ex) { MessageBox.Show("开始挂机有异常:" + ex.Message); } }); }
private void 开始恶作剧ToolStripMenuItem_Click(object sender, EventArgs e) { if (!Code.CGlobalVariable.g_bStartGame) { // 添加到DLL for (int i = 0; i < Code.CGlobalVariable.g_AccountList.Count; i++) { var Account = Code.CGlobalVariable.g_AccountList[i]; API.AccountHandle(0x1, Account.strUserName + "," + Account.strPassWord); } ReadConfig(); // 设置禁止启动项 CGlobalVariable.g_bStartGame = true; 恶作剧开始ToolStripMenuItem.Enabled = false; 设置ToolStripMenuItem.Enabled = false; 刷新ToolStripMenuItem.Enabled = false; 开始挂机ToolStripMenuItem.Enabled = false; 一键收邮件ToolStripMenuItem.Enabled = true; // 启动刷新线程 _ConsoleLog.Run(SetDgvValue); } API.SetGameRun(1); }
private void 单帐号收邮件删号ToolStripMenuItem_Click(object sender, EventArgs e) { 单帐号收邮件删号ToolStripMenuItem.Enabled = false; Task.Factory.StartNew(() => { int nIndex = GetSelectIndex(); if (nIndex == -1) { MessageBox.Show("至少你也要选中一行吧?"); return; } lock (Code.CGlobalVariable.g_AccountList) { API.AccountHandle(0x8, Code.CGlobalVariable.g_AccountList[nIndex].strUserName); } 单帐号收邮件删号ToolStripMenuItem.Enabled = true; }); }
private void 所有帐号停止挂机ToolStripMenuItem_Click(object sender, EventArgs e) { 停止挂机ToolStripMenuItem.Enabled = false; Task.Factory.StartNew(() => { try { lock (Code.CGlobalVariable.g_AccountList) { foreach (var itm in Code.CGlobalVariable.g_AccountList) { API.AccountHandle(0x4, itm.strUserName); } } 停止挂机ToolStripMenuItem.Enabled = true; } catch (Exception ex) { MessageBox.Show("停止挂机有异常:" + ex.Message); } }); }