/// <summary> /// 获取余额 /// </summary> /// <returns></returns> public static decimal getYuE(string url, CookieContainer webCookie) { decimal keYongJinE = 0; try { //{"d":"[{\"Rows\":[{\"memberno\":\"ffgggg7788\",\"membername\":\"哥\",\"opena\":false,\"openb\":true,\"openc\":false, //\"opend\":false,\"opene\":false,\"credittype\":2,\"accounttype\":1,\"creditquota\":10.0000,\"usecreditquota\":0.00, //\"usecreditquota2\":0.00,\"allowcreditquota\":10.00}]},0.0000]"} string resultGetMembersInfo = HttpHelps.PostJson("", url + "/cp2-dfgj-mb/ch/main.aspx/GetMembersMbinfo", webCookie, Encoding.UTF8); string credits = function.middlestring(resultGetMembersInfo, ",\\\"creditquota\\\":", ","); if (credits.Length > 0) { keYongJinE = decimal.Parse(credits); } else { keYongJinE = -1; } } catch (Exception ex) { //function.log("永利获取余额失败" + ex.Message); keYongJinE = -1; } return(keYongJinE); }
/// <summary> /// 尝试下注 /// </summary> /// <param name="url"></param> /// <param name="webCookie"></param> /// <param name="transtring">"212,,1,,1.9428,10;"</param> /// <param name="arrstring">"212:1:10;"</param> /// <param name="creditquota">金额</param> /// <returns></returns> public static bool postXiaZhu(string url, CookieContainer webCookie, string transtring, string arrstring) { string pb = "B"; //parent.main_mbopen string gameno = "6"; string lianma_transtrin = ""; //空 string creditquota = getYuE(url, webCookie).ToString(); //获取 xindan_roundno //cd-> xindan_roundno -> parent.roundno //{"d":"{\"code\":1,\"message\":{\"sd\":\"20171124-018\",\"soTs\":-1, //\"seTs\":-1,\"swTs\":-1,\"cd\":\"20171124-019\",\"coTs\":-137,\"ceTs\":123,\"cwTs\":204,\"nd\":\"20171124-020\",\"noTs\":40,\"neTs\":260, //\"nwTs\":81,\"jgTs\":41,\"kjTs\":300,\"ld\":\"20171124-018\",\"lr\":[\"8\",\"9\",\"1\",\"9\",\"7\"]}}"} string resultLoadDrawsInfo = HttpHelps.PostJson("{gameno:" + gameno + "}", url + "/cp2-dfgj-mb/app/ws_game.asmx/LoadDrawsInfo", webCookie, Encoding.UTF8); string xindan_roundno = function.middlestring(resultLoadDrawsInfo, "\\\"cd\\\":\\\"", "\\\""); // string formToken = ""; if (xindan_roundno.Length > 0) { //下注前验证 //{wagerround:"B",transtring:"212,,1,,1.9428,10;",arrstring:"212:1:10;",wagetype:0,allowcreditquota:10,hasToken:true} //"{wagerround:\"" + pb + "\",transtring:\"" + transtring + "\",arrstring:\"" + arrstring + "\",wagetype:" // + (wagetype != undefined ? wagetype : 0) + ",allowcreditquota:" + (pricecount != undefined || pricecount != "" ? pricecount : 0) + ",hasToken:true}" string postDataA = "{wagerround:\"" + pb + "\",transtring:\"" + transtring + "\",arrstring:\"" + arrstring + "\",wagetype:0,allowcreditquota:" + creditquota + ",hasToken:true}"; string resuleA = HttpHelps.PostJson(postDataA, url + "/cp2-dfgj-mb/ch/left.aspx/GetMemberMtran", webCookie, Encoding.UTF8); string[] res = resuleA.Split(new string[] { "$@" }, StringSplitOptions.None); if (res.Length == 7) { formToken = res[6].Replace("\"}", ""); } } function.log("下注参数:" + transtring + " " + arrstring + " " + xindan_roundno + " " + formToken); bool isSuccess = false; if (formToken.Length > 0 && xindan_roundno.Length > 0) { //确认下注 //"{gameno:" + parent.gameno + ",wagerroundstring:\"" + pb + "\",arrstring:\"" + arrs + "\",roundno:\"" + xindan_roundno + "\",lianma_transtrin:\"" + lianma_transtrin + "\",token:\"" + formToken + "\"}" string postDataB = "{gameno:\"" + gameno + "\",wagerroundstring:\"" + pb + "\",arrstring:\"" + arrstring + "\",roundno:\"" + xindan_roundno + "\",lianma_transtrin:\"" + lianma_transtrin + "\",token:\"" + formToken + "\"}"; string resuleB = HttpHelps.PostJson(postDataB, url + "/cp2-dfgj-mb/ch/left.aspx/mtran_XiaDan_New", webCookie, Encoding.UTF8); //function.log("下注结果:" + resuleB); //没有该游戏操作权限! //超过您的每日信用额度,无法下注,请联系上级代理 if (resuleB.IndexOf("没有该游戏操作权限") > -1 || resuleB.IndexOf("超过您的每日信用额度") > -1 || resuleB.IndexOf("索引超出了数组界限") > -1) { isSuccess = false; function.log("下注错误:" + resuleB); } else { isSuccess = true; function.log("下注成功:" + resuleB); } } return(isSuccess); }
/// <summary> /// 获取用户信息x /// </summary> /// <param name="url"></param> /// <param name="webCookie"></param> /// <returns></returns> public static string getUserInfo(string url, CookieContainer webCookie) { string resultGetMembersInfo = HttpHelps.PostJson("", url + "/cp2-dfgj-mb/ch/main.aspx/GetMembersMbinfo", webCookie, Encoding.UTF8); return(resultGetMembersInfo); }