/// <summary> /// “摇一摇”按钮点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnShake_Click(object sender, EventArgs e) { if (!GlobalContext.CheckLoginState()) { return; } ThreadPool.QueueUserWorkItem(o => { try { Output("正在摇一摇..."); var usedAmount = float.Parse(this.comboBox2.Text); var playResult = GlobalContext.PH.PlayBBZC(GlobalContext.CurrentCookieString, usedAmount); var leftAmount = playResult.money - usedAmount; Output(string.Format("{0}了 {1} 金!", leftAmount >= 0 ? "赢" : "输", Math.Abs(leftAmount))); } catch (Exception ex) { Output("摇一摇失败," + ex.Message); } }); }
/// <summary> /// “来一脚”按钮点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnKick_Click(object sender, EventArgs e) { if (!GlobalContext.CheckLoginState()) { return; } ThreadPool.QueueUserWorkItem(o => { try { if (this.m_gameCookie == null || this.m_cookie != GlobalContext.CurrentCookieString) { Output("正在获取游戏Cookie..."); this.m_gameCookie = GlobalContext.PH.GetGameCookie( GlobalContext.CurrentCookieString, this.btnKick.Tag as string); this.m_cookie = GlobalContext.CurrentCookieString; } Output("正在踢球..."); var usedAmount = float.Parse(this.comboBox1.Text); var playResult = GlobalContext.PH.PlayBBCM(this.m_gameCookie, usedAmount); var leftAmount = playResult.prizeAmount - usedAmount; Output(string.Format("{0}了 {1} 金!", leftAmount >= 0 ? "赢" : "输", Math.Abs(leftAmount))); } catch (Exception ex) { Output("踢球失败," + ex.Message); } }); }
/// <summary> /// 游戏图片点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GamePictureOnClick(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Left) { return; } if (!GlobalContext.CheckLoginState()) { return; } string gameUrl = (sender as PictureBox).Tag.ToString(); //var frmWeb = new FrmWeb(gameUrl); ThreadPool.QueueUserWorkItem(o => { try { this.m_cookie = GlobalContext.CurrentCookieString; if (gameUrl.Contains("http://wap.pahys.com")) { Output("正在获取游戏Cookie..."); this.m_gameCookie = GlobalContext.PH.GetGameCookie( GlobalContext.CurrentCookieString, gameUrl); this.m_cookie = this.m_gameCookie; } Output("获取成功,正在打开页面..."); PapdHelper.SetIECookie(gameUrl, this.m_cookie); //frmWeb.Show(); System.Diagnostics.Process.Start("iexplore.exe", gameUrl); Output("执行成功!"); } catch (Exception ex) { Output("执行失败," + ex.Message); //frmWeb.Dispose(); } }); }
protected bool CheckLoginState() { return(GlobalContext.CheckLoginState()); }