public static feiPanJieGuo xiaZhu_shunfen(xztj xiaZhu, string qiHao, feiPanJieGuo fpjgData) { _serPeilv = ServerShunFeng.getPeilv(FeidanUrlShunFen, _webCookieShunFen); decimal yuE = 0; if (IsLoginSuccess && _serPeilv != null) { fpjgData = ServerShunFeng.xiaZhu(FeidanUrlShunFen, _webCookieShunFen, _serPeilv, xiaZhu, _serValidate, qiHao, fpjgData); if (fpjgData.isSuccess == true) { //获取余额 yuE = ServerShunFeng.getYuE(FeidanUrlShunFen, _webCookieShunFen); } } else { fpjgData.isSuccess = false; fpjgData.errorMessage = "链接异常"; //提交失败 fpjgData = ServerCommon.SetFeiPanJieGuo(fpjgData, false); } fpjgData.yuE = yuE.ToString(); KeYongYuE = yuE; return(fpjgData); }
public static decimal getYuE() { if (ServerType.Equals("顺丰")) { decimal yue = ServerShunFeng.getYuE(FeidanUrlShunFen, _webCookieShunFen); if (yue > -1) { KeYongYuE = yue; } } else if (ServerType.Equals("永利")) { decimal yue = ServerYongLi.getYuE(FeidanUrlYongLi, _webCookieYongLi); if (yue > -1) { KeYongYuE = yue; } } return(KeYongYuE); }
public static feiPanJieGuo xiaZhu(string url, CookieContainer webCookie, peilv peiLv, xztj xiaZhu, string validate, string qiHao, feiPanJieGuo fpjgData) { fpjgData.isSuccess = false; feiPanJieGuo fpjgDataTemp = new feiPanJieGuo(); int xiaZhuJiFen = 0; //获取余额 decimal yuE = ServerShunFeng.getYuE(url, webCookie); try { int xiaZhuJiFen_Temp = 0; string s_uPI_ID = ""; string s_uPI_P = ""; string s_uPI_M = ""; bool tiJiaoResult = false; #region 大小单双 s_uPI_ID = ""; s_uPI_P = ""; s_uPI_M = ""; xiaZhuJiFen_Temp = 0; for (int i = 0; i < 5; i++)//大小单双 { for (int x = 0; x < 4; x++) { if (xiaZhu.DXDS[i, x] > 0 && fpjgData.DXDS[i, x] == false) { s_uPI_ID += "," + fpCanShu.DXDS[i, x]; s_uPI_P += "," + peiLv.DXDS[i, x]; s_uPI_M += "," + xiaZhu.DXDS[i, x]; xiaZhuJiFen_Temp += xiaZhu.DXDS[i, x]; } } } //提交数据 if (xiaZhuJiFen_Temp > yuE) { tiJiaoResult = false; fpjgData.isSuccess = false; fpjgData.errorMessage = "金额不足"; } else if (s_uPI_ID.Length > 0) { function.log("下注大小单双"); tiJiaoResult = postXiaZhu(url, webCookie, validate, s_uPI_ID, s_uPI_P, s_uPI_M); if (tiJiaoResult == true) { //===================2018-02=================== //提交成功 fpjgDataTemp = new feiPanJieGuo(); for (int i = 0; i < 5; i++)//大小单双 { for (int x = 0; x < 4; x++) { fpjgData.DXDS[i, x] = true; fpjgDataTemp.DXDS[i, x] = true; } } xiaZhuJiFen += xiaZhuJiFen_Temp; yuE -= xiaZhuJiFen_Temp; function.FpLog(qiHao, xiaZhu, fpjgDataTemp); //===================2018-02=================== } else { fpjgData.isSuccess = false; fpjgData.errorMessage = "下注失败"; } } else { tiJiaoResult = true;//x } #endregion 大小单双 #region 单球 for (int x = 0; x < 5; x++) { if (tiJiaoResult == true) { //提交成功继续 s_uPI_ID = ""; s_uPI_P = ""; s_uPI_M = ""; xiaZhuJiFen_Temp = 0; for (int i = 0; i < 5; i++) { if (xiaZhu.QD[x, i] > 0 && fpjgData.QD[x, i] == false) { s_uPI_ID += "," + fpCanShu.QD[x, i]; s_uPI_P += "," + peiLv.QD[x, i]; s_uPI_M += "," + xiaZhu.QD[x, i]; xiaZhuJiFen_Temp += xiaZhu.QD[x, i]; } } //提交数据 if (xiaZhuJiFen_Temp > yuE) { tiJiaoResult = false; fpjgData.isSuccess = false; fpjgData.errorMessage = "金额不足"; } else if (s_uPI_ID.Length > 0) { tiJiaoResult = postXiaZhu(url, webCookie, validate, s_uPI_ID, s_uPI_P, s_uPI_M); if (tiJiaoResult == true) { //===================2018-02=================== //提交成功 fpjgDataTemp = new feiPanJieGuo(); for (int i = 0; i < 5; i++) { fpjgData.QD[x, i] = true; fpjgDataTemp.QD[x, i] = true; } xiaZhuJiFen += xiaZhuJiFen_Temp; yuE -= xiaZhuJiFen_Temp; function.FpLog(qiHao, xiaZhu, fpjgDataTemp); //===================2018-02=================== } else { fpjgData.isSuccess = false; fpjgData.errorMessage = "下注失败"; } } else { tiJiaoResult = true;//x } } if (tiJiaoResult == true) { //提交成功继续 s_uPI_ID = ""; s_uPI_P = ""; s_uPI_M = ""; xiaZhuJiFen_Temp = 0; for (int i = 5; i < 10; i++) { if (xiaZhu.QD[x, i] > 0 && fpjgData.QD[x, i] == false) { s_uPI_ID += "," + fpCanShu.QD[x, i]; s_uPI_P += "," + peiLv.QD[x, i]; s_uPI_M += "," + xiaZhu.QD[x, i]; xiaZhuJiFen_Temp += xiaZhu.QD[x, i]; } } //提交数据 if (xiaZhuJiFen_Temp > yuE) { tiJiaoResult = false; fpjgData.isSuccess = false; fpjgData.errorMessage = "金额不足"; } else if (s_uPI_ID.Length > 0) { tiJiaoResult = postXiaZhu(url, webCookie, validate, s_uPI_ID, s_uPI_P, s_uPI_M); if (tiJiaoResult == true) { //===================2018-02=================== //提交成功 fpjgDataTemp = new feiPanJieGuo(); for (int i = 5; i < 10; i++) { fpjgData.QD[x, i] = true; fpjgDataTemp.QD[x, i] = true; } xiaZhuJiFen += xiaZhuJiFen_Temp; yuE -= xiaZhuJiFen_Temp; function.FpLog(qiHao, xiaZhu, fpjgDataTemp); //===================2018-02=================== } else { fpjgData.isSuccess = false; fpjgData.errorMessage = "下注失败"; } } else { tiJiaoResult = true;//x } } } #endregion 单球 #region 龙虎和 总和 if (tiJiaoResult == true) { //提交成功继续 s_uPI_ID = ""; s_uPI_P = ""; s_uPI_M = ""; xiaZhuJiFen_Temp = 0; for (int i = 0; i < 3; i++)//龙虎和 { if (xiaZhu.LHH[i] > 0 && fpjgData.LHH[i] == false) { s_uPI_ID += "," + fpCanShu.LHH[i]; s_uPI_P += "," + peiLv.LHH[i]; s_uPI_M += "," + xiaZhu.LHH[i]; xiaZhuJiFen_Temp += xiaZhu.LHH[i]; } } for (int i = 0; i < 4; i++)//总和 总和组合 龙虎和 { if (xiaZhu.ZHDXDS[i] > 0 && fpjgData.ZHDXDS[i] == false) { s_uPI_ID += "," + fpCanShu.ZHDXDS[i]; s_uPI_P += "," + peiLv.ZHDXDS[i]; s_uPI_M += "," + xiaZhu.ZHDXDS[i]; xiaZhuJiFen_Temp += xiaZhu.ZHDXDS[i]; } } //提交数据 if (xiaZhuJiFen_Temp > yuE) { tiJiaoResult = false; fpjgData.isSuccess = false; fpjgData.errorMessage = "金额不足"; } else if (s_uPI_ID.Length > 0) { tiJiaoResult = postXiaZhu(url, webCookie, validate, s_uPI_ID, s_uPI_P, s_uPI_M); if (tiJiaoResult == true) { //===================2018-02=================== //提交成功 fpjgDataTemp = new feiPanJieGuo(); for (int i = 0; i < 3; i++)//龙虎和 { fpjgData.LHH[i] = true; fpjgDataTemp.LHH[i] = true; } for (int i = 0; i < 4; i++)//总和 总和组合 龙虎和 { fpjgData.ZHDXDS[i] = true; fpjgDataTemp.LHH[i] = true; } xiaZhuJiFen += xiaZhuJiFen_Temp; yuE -= xiaZhuJiFen_Temp; function.FpLog(qiHao, xiaZhu, fpjgDataTemp); //===================2018-02=================== } else { fpjgData.isSuccess = false; fpjgData.errorMessage = "下注失败"; } } else { tiJiaoResult = true;//x } } #endregion 龙虎和 总和 for (int i = 0; i < 4; i++)//总和组合 { fpjgData.ZHZHDXDS[i] = true; } if (tiJiaoResult == true) { fpjgData.isSuccess = true; } } catch (Exception ex) { fpjgData.isSuccess = false; fpjgData.errorMessage = "下注错误"; function.log("下注错误" + qiHao + " " + fpjgData.errorMessage); //提交失败 //fpjgData = ServerCommon.SetJieGuoFaile(fpjgData); throw ex; } // fpjgData.xiaZhu = xiaZhuJiFen.ToString(); return(fpjgData); }
/// <summary> /// 保持登录状态 /// </summary> public static bool login(string url, string username, string userpass, string serType) { if (username.Length == 0 && userpass.Length == 0) { return(false); } bool isSuccess = false; //登录获取Cookie if (serType.Equals("顺丰")) { FeidanUrlShunFen = url; // if (ServerShunFeng.checkLogin(FeidanUrlShunFen, _webCookieShunFen)) { function.log("顺丰已经登录。"); isSuccess = true; } else { isSuccess = ServerShunFeng.login(FeidanUrlShunFen, username, userpass, _webCookieShunFen, 5); } // // KeYongYuE = ServerShunFeng.getYuE(FeidanUrlShunFen, _webCookieShunFen); //获取验证 _serValidate = ServerShunFeng.getValidate(FeidanUrlShunFen, _webCookieShunFen); // FeidanUrl = FeidanUrlShunFen; } else if (serType.Equals("永利")) { try { if (ServerYongLi.checkLogin(FeidanUrlYongLi, _webCookieYongLi)) { function.log("永利已经登录。"); isSuccess = true; } else { isSuccess = ServerYongLi.login(url, username, userpass, _webCookieYongLi, out FeidanUrlYongLi); } } catch (Exception ex) { function.log("网站链接错误" + ex.Message); } // KeYongYuE = ServerYongLi.getYuE(FeidanUrlYongLi, _webCookieYongLi); // FeidanUrl = FeidanUrlYongLi; } // function.log("当期登录服务器" + FeidanUrl); ServerUrl = url; IsLoginSuccess = isSuccess; ServerType = serType; LoginName = username; LoginPass = userpass; return(isSuccess); }