Beispiel #1
0
        public static int bet(UserInfo ui, string[] arr, int Type)
        {
            string cul = null;

            if (Type == 1)
            {
                cul = arr[21];
            }
            else
            {
                cul = arr[22];
            }

            string    cUrl  = "http://" + ui.cUrl + "/app/member/" + cul + "&uid=" + ui.Uid + "&langx=zh-cn";
            string    cR    = "http://" + ui.cUrl + "/app/member/select.php?uid=" + ui.Uid + "&langx=zh-cn";
            string    s     = Connect.getDocument(cUrl, ui.cc, cR);
            Hashtable data  = Pfun.fromSetting(s);
            string    Url   = "http://" + ui.cUrl + "/" + data["url"].ToString();
            string    data1 = data["data"].ToString().Replace("btnCancel=取消&Submit=确定交易&wgCancel=取消&wgSubmit=确定交易&", "");

            data1 = data1.Substring(0, data1.Length - 1);
            data1 = data1.Replace("gold=", "gold=" + Conf.money);
            s     = Connect.postDocument(Url, data1, ui.cc, cUrl);
            if (s.IndexOf("成功提交注单") > 0)
            {
                Console.WriteLine("成功提交注单");
                return(1);
            }
            return(0);
        }
Beispiel #2
0
        public static UserInfo Odds(UserInfo ui)
        {
            // string cReferer = "https://www.sbobet.com/zh-cn/euro";
            CookieContainer cc      = ui.cc;
            string          Url     = ui.cUrl;
            Uri             siteUri = new Uri(Url);
            // string cUrl="http://bbo3x32e5jh3.asia.sbobet.com/web-root/restricted/odds-display/today-data.aspx?od-param=1,1,1,1,1,2,2,2,1&fi=1&v=0&dl=1"

            string cUrl = "http://" + siteUri.Host.Trim() + "/web-root/restricted/odds-display/today-data.aspx?od-param=1,1,1,1,1,2,2,2,1&fi=1&v=0&dl=1";
            string s    = Connect.getDocument(cUrl, cc);

            s = Pfun.FromUnicodeString(s);
            //Console.WriteLine(s);
            if (s.IndexOf("logout.aspx") > 0)
            {
                Console.WriteLine("logout");
                ui.Status = 0;
                return(ui);
            }
            System.Diagnostics.Stopwatch sh = new System.Diagnostics.Stopwatch();
            string jsFilePath = Application.StartupPath + "\\js\\seb.js";
            string funcName   = "ODDS";

            try
            {
                string cJSONData = s.Substring(s.IndexOf("["), s.LastIndexOf(")") - s.IndexOf("["));
                // cJSONData = cJSONData.Substring(0, cJSONData.LastIndexOf("]") + 1).Trim();
                //cJSONData = "var arr=" + cJSONData+";";
                object[] paramers = new object[1] {
                    cJSONData.Trim().Replace("\n", "").Replace("\r", "").Replace(",'", ",\"").Replace("',", "\",").Replace("\"'", "\"\"").Replace("']", "\"]").Replace("'", "")
                };
                string sScript = TextFile.ReadFile(jsFilePath);

                ScriptEngine se  = new ScriptEngine(ScriptLanguage.JavaScript);
                object       obj = se.Run(funcName, paramers, sScript);
                if (obj.Equals("缺少 ']'"))
                {
                    ui.ODDS = cJSONData;
                    return(ui);
                }
                string[] p = obj.ToString().Split('\n');
                for (int i = 0; i < p.Length; i++)
                {
                    string[]  arr = p[i].Split(new char[] { ',', '|', ':' });
                    Hashtable ht  = ParseLineds(arr);
                }

                ui.ODDS   = obj.ToString();
                ui.Status = 1;
                return(ui);
            }catch (Exception ex) {
                return(ui);
            }
        }
Beispiel #3
0
        public static DataTable Select(string Lid, string OddsID, string Odds)
        {
            double Q1 = 0;
            double Q2 = 0;

            string    Sql = "SELECT * FROM `db_odds` where Lid=" + Lid;
            DataTable Dt  = DbHelperMySQL.DQuery(Sql);
            DataRow   dr  = null;

            for (int i = 0; i < Dt.Rows.Count; i++)
            {
                if (Dt.Rows[i]["pan"].ToString().Trim() == "" || Dt.Rows[i]["pan"].ToString() == null)
                {
                    continue;
                }
                //dr = Dt.Rows[i];
                try
                {
                    double Q1adds = Convert.ToDouble(Dt.Rows[i]["Q1adds"]);
                    double Q2adds = Convert.ToDouble(Dt.Rows[i]["Q2adds"]);
                    if (i == 0)
                    {
                        Q1 = Q1adds;
                        Q2 = Q2adds;
                        dr = Dt.Rows[i];
                    }
                    if (Q1 - Q1adds > 0.2 || Q2 - Q2adds > 0.2)
                    {
                        Hashtable drs = new Hashtable();

                        //Console.WriteLine(dr["pan"].ToString());

                        //Console.Write(Dt.Rows[i]["Q1"].ToString());
                        //Console.WriteLine(Dt.Rows[i]["Q1adds"] +"---"+ Q1+"--"+ Lid);

                        drs["Lid"] = Dt.Rows[i]["Lid"].ToString();
                        drs["Ls"]  = Dt.Rows[i]["Ls"].ToString();
                        drs["Q1"]  = Dt.Rows[i]["Q1"].ToString();
                        drs["Q2"]  = Dt.Rows[i]["Q2"].ToString();
                        drs["H"]   = dr["HC"].ToString();
                        drs["C"]   = Dt.Rows[i]["HC"].ToString();

                        drs["PAN1"]     = dr["pan"].ToString();
                        drs["PAN2"]     = Dt.Rows[i]["pan"].ToString();
                        drs["Q1ODDS"]   = dr["Q1adds"].ToString();
                        drs["Q1ODDS_F"] = Dt.Rows[i]["Q1adds"].ToString();
                        drs["Q2ODDS"]   = dr["Q2adds"].ToString();
                        drs["Q2ODDS_F"] = Dt.Rows[i]["Q2adds"].ToString();
                        //drs["stime"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");


                        string sql = SqlBuilderHelper.InsertSQL(drs, "acc_log");
                        Console.WriteLine(sql);
                        int b = DbHelperMySQL.ExecuteSql(sql);
                        if (b == 1)
                        {
                            //DataRow drr = Conf.WhereLianSai.NewRow();
                            Pfun.HashToRow(drs);
                            //Conf.WhereLianSai.Rows.Add(drr);
                        }
                    }
                    if (Q2 - Q2adds > 0.2)
                    {
                        //Console.Write(Dt.Rows[i]["Q2"]);
                        //Console.WriteLine(Dt.Rows[i]["Q2adds"] + "---" + Q2+"--"+ Lid);
                    }


                    Q1 = Q1adds;
                    Q2 = Q2adds;
                    dr = Dt.Rows[i];
                }
                catch {
                    //Console.WriteLine(Dt.Rows[i]["Q1adds"]);
                }
            }
            return(Dt);
        }