Exemplo n.º 1
0
        /// <summary>
        /// 取得篮球每节比分
        /// </summary>
        /// <param name="Types">1一节,2二节,3上半场,4第三节</param>
        /// <param name="p_TPRtime">联赛时间</param>
        /// <param name="p_id">比赛ID</param>
        /// <returns></returns>
        public string DJBf(int Types, DateTime p_TPRtime, int p_id)
        {
            string bfstat = "未";

            if (p_TPRtime < DateTime.Now)
            {
                bfstat = "0:0";
                string p_xml = GetSourceTextByUrl("http://bf.titan007.com/nba/today.xml", "GB2312");
                TPR3.Model.guess.Tempbakbf n = new TPR3.Model.guess.Tempbakbf();
                using (XmlReaderExtend reader = new XmlReaderExtend(p_xml))
                {
                    while (reader.ReadToFollowing("h"))
                    {
                        string p_str = reader.GetElementValue();

                        string[] Temp = Regex.Split(p_str, @"\^");
                        int      id   = 0;

                        id = Convert.ToInt32(Temp[0]);

                        if (id == p_id)
                        {
                            if (Types == 0)//全场比分
                            {
                                bfstat = Temp[11] + "-" + Temp[12];
                            }
                            else if (Types == 1)
                            {
                                bfstat = Temp[13] + "-" + Temp[14];
                            }
                            else if (Types == 2)
                            {
                                bfstat = Temp[15] + "-" + Temp[16];
                            }
                            else if (Types == 3)
                            {
                                bfstat = (Utils.ParseInt(Temp[13]) + Utils.ParseInt(Temp[15])) + "-" + (Utils.ParseInt(Temp[14]) + Utils.ParseInt(Temp[16]));
                            }
                            else if (Types == 4)
                            {
                                bfstat = Temp[17] + "-" + Temp[18];
                            }

                            break;
                        }
                    }
                }
            }

            if (bfstat == "-")
            {
                bfstat = "未";
            }

            return(bfstat);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 处理足球标准盘XML
        /// </summary>
        /// <param name="p_html">HTML文档</param>
        private IList <TPR2.Model.guess.BaList> FootbzHtml(string p_xml, out int p_recordCount)
        {
            IList <TPR2.Model.guess.BaList> listFootbzs = new List <TPR2.Model.guess.BaList>();

            p_recordCount = 0;
            try
            {
                using (XmlReaderExtend reader = new XmlReaderExtend(p_xml))
                {
                    while (reader.ReadToFollowing("m"))
                    {
                        TPR2.Model.guess.BaList obj = new TPR2.Model.guess.BaList();
                        obj.p_id      = Convert.ToInt32(reader.GetElementValue("i"));
                        obj.p_TPRtime = Convert.ToDateTime(reader.GetElementValue("t").Split(",".ToCharArray())[0]);

                        string[] saTemp = { };
                        saTemp = reader.GetElementValue("pl").Split(";".ToCharArray());
                        try
                        {
                            //SB:1/明升:9
                            //if (Utils.GetTopDomain() == "tl88.cc" || Utils.GetTopDomain() == "168yy.cc")
                            //{
                            //obj.p_bzs_lu = Convert.ToDecimal(saTemp[9].Split(",".ToCharArray())[4]);
                            //obj.p_bzp_lu = Convert.ToDecimal(saTemp[9].Split(",".ToCharArray())[5]);
                            //obj.p_bzx_lu = Convert.ToDecimal(saTemp[9].Split(",".ToCharArray())[6]);
                            //}
                            //else
                            //{
                            obj.p_bzs_lu = Convert.ToDecimal(saTemp[1].Split(",".ToCharArray())[4]);
                            obj.p_bzp_lu = Convert.ToDecimal(saTemp[1].Split(",".ToCharArray())[5]);
                            obj.p_bzx_lu = Convert.ToDecimal(saTemp[1].Split(",".ToCharArray())[6]);
                            //}
                        }
                        catch
                        {
                            obj.p_bzs_lu = 0;
                            obj.p_bzp_lu = 0;
                            obj.p_bzx_lu = 0;
                        }

                        listFootbzs.Add(obj);
                        p_recordCount++;
                    }
                    return(listFootbzs);
                }
            }
            catch
            {
                return(null);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 处理足球大小盘XML
        /// </summary>
        /// <param name="p_html">HTML文档</param>
        private IList <TPR3.Model.guess.BaList> FootdxHtml(string p_xml, out int p_recordCount)
        {
            IList <TPR3.Model.guess.BaList> listFootdxs = new List <TPR3.Model.guess.BaList>();

            p_recordCount = 0;
            try
            {
                using (XmlReaderExtend reader = new XmlReaderExtend(p_xml))
                {
                    while (reader.ReadToFollowing("m"))
                    {
                        TPR3.Model.guess.BaList obj = new TPR3.Model.guess.BaList();
                        obj.p_id      = Convert.ToInt32(reader.GetElementValue("i"));
                        obj.p_TPRtime = Convert.ToDateTime(reader.GetElementValue("t").Split(",".ToCharArray())[0]);

                        string[] saTemp = { };
                        saTemp = reader.GetElementValue("pl").Split(";".ToCharArray());
                        try
                        {
                            //SB:1/明升:9
                            if (Utils.GetTopDomain() == "tt8w.cn" || Utils.GetTopDomain() == "tt8w.cc")
                            {
                                obj.p_dx_pk    = Convert.ToDecimal(saTemp[9].Split(",".ToCharArray())[1]);
                                obj.p_big_lu   = Convert.ToDecimal(saTemp[9].Split(",".ToCharArray())[2]);
                                obj.p_small_lu = Convert.ToDecimal(saTemp[9].Split(",".ToCharArray())[3]);
                            }
                            else
                            {
                                obj.p_dx_pk    = Convert.ToDecimal(saTemp[1].Split(",".ToCharArray())[1]);
                                obj.p_big_lu   = Convert.ToDecimal(saTemp[1].Split(",".ToCharArray())[2]);
                                obj.p_small_lu = Convert.ToDecimal(saTemp[1].Split(",".ToCharArray())[3]);
                            }
                        }
                        catch
                        {
                            obj.p_dx_pk    = 0;
                            obj.p_big_lu   = 0;
                            obj.p_small_lu = 0;
                        }
                        listFootdxs.Add(obj);
                        p_recordCount++;
                    }

                    return(listFootdxs);
                }
            }
            catch
            {
                return(null);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 取得篮球进行第几节
        /// </summary>
        /// <param name="p_TPRtime">联赛时间</param>
        /// <param name="p_id">比赛ID</param>
        /// <returns></returns>
        public string LqOutJie(DateTime p_TPRtime, int p_id)
        {
            string bfstat = "";

            if (p_TPRtime < DateTime.Now)
            {
                string p_xml = GetSourceTextByUrl("http://bf.titan007.com/nba/today.xml", "GB2312");
                TPR3.Model.guess.Tempbakbf n = new TPR3.Model.guess.Tempbakbf();
                using (XmlReaderExtend reader = new XmlReaderExtend(p_xml))
                {
                    while (reader.ReadToFollowing("h"))
                    {
                        string p_str = reader.GetElementValue();

                        string[] Temp = Regex.Split(p_str, @"\^");
                        int      id   = 0;

                        id = Convert.ToInt32(Temp[0]);

                        if (id == p_id)
                        {
                            //取第几节
                            string jie        = OutJie(Temp[5]);
                            string remaintime = Temp[6];
                            if (remaintime != "")
                            {
                                bfstat = jie + "(" + remaintime + "')";
                            }
                            else
                            {
                                bfstat = jie;
                            }

                            break;
                        }
                    }
                }
            }
            return(bfstat);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 处理篮球XML
        /// </summary>
        /// <param name="p_html">HTML文档</param>
        private IList <TPR2.Model.guess.BaList> BasketHtml(string p_xml, out int p_recordCount)
        {
            IList <TPR2.Model.guess.BaList> listBaskets = new List <TPR2.Model.guess.BaList>();

            p_recordCount = 0;
            try
            {
                using (XmlReaderExtend reader = new XmlReaderExtend(p_xml))
                {
                    while (reader.ReadToFollowing("m"))
                    {
                        TPR2.Model.guess.BaList obj = new TPR2.Model.guess.BaList();
                        obj.p_id      = Convert.ToInt32(reader.GetElementValue("i"));
                        obj.p_title   = reader.GetElementValue("le").Split(",".ToCharArray())[2];
                        obj.p_TPRtime = Convert.ToDateTime(reader.GetElementValue("t").Split(",".ToCharArray())[0]);
                        obj.p_one     = reader.GetElementValue("ta").Split(",".ToCharArray())[0];
                        obj.p_two     = reader.GetElementValue("tb").Split(",".ToCharArray())[0];

                        if (Utils.Left(reader.GetElementValue("p"), 1) == "2")
                        {
                            obj.p_pn = 2;
                        }
                        else
                        {
                            obj.p_pn = 1;
                        }


                        string[] saTemp = { };
                        saTemp = reader.GetElementValue("pl").Split(";".ToCharArray());
                        try
                        {
                            obj.p_pk     = Convert.ToDecimal(saTemp[2].Split(",".ToCharArray())[1]);
                            obj.p_one_lu = Convert.ToDecimal(saTemp[2].Split(",".ToCharArray())[2]);
                            obj.p_two_lu = Convert.ToDecimal(saTemp[2].Split(",".ToCharArray())[3]);
                        }
                        catch
                        {
                            obj.p_pk     = 0;
                            obj.p_one_lu = 0;
                            obj.p_two_lu = 0;
                        }
                        try
                        {
                            obj.p_dx_pk    = Convert.ToDecimal(saTemp[7].Split(",".ToCharArray())[1]);
                            obj.p_big_lu   = Convert.ToDecimal(saTemp[7].Split(",".ToCharArray())[2]);
                            obj.p_small_lu = Convert.ToDecimal(saTemp[7].Split(",".ToCharArray())[3]);
                        }
                        catch
                        {
                            obj.p_dx_pk    = 0;
                            obj.p_big_lu   = 0;
                            obj.p_small_lu = 0;
                        }
                        listBaskets.Add(obj);
                        p_recordCount++;
                    }
                    return(listBaskets);
                }
            }
            catch
            {
                return(null);
            }
        }
Exemplo n.º 6
0
    /// <summary>
    /// 篮球比分分析
    /// </summary>
    /// <param name="p_basketve"></param>
    /// <param name="p_TPRtime"></param>
    /// <param name="ID"></param>
    /// <param name="p_id"></param>
    private void basket(int p_basketve, DateTime p_TPRtime, int ID, int p_id)
    {
        int Types = p_basketve;
        int bf1   = -1;
        int bf2   = -1;

        string p_xml = GetSourceTextByUrl("http://bf.win007.com/nba_date.aspx?time=" + p_TPRtime.ToString("yyyy-MM-dd") + "", "GB2312");

        TPR2.Model.guess.Tempbakbf n = new TPR2.Model.guess.Tempbakbf();
        using (XmlReaderExtend reader = new XmlReaderExtend(p_xml))
        {
            while (reader.ReadToFollowing("h"))
            {
                string p_str = reader.GetElementValue();

                string[] Temp  = Regex.Split(p_str, @"\^");
                int      id    = 0;
                int      state = 0;

                id    = Convert.ToInt32(Temp[0]);
                state = Convert.ToInt32(Temp[5]);//状态:0:未开赛,1:一节,2:二节,5:1'OT,以此类推,-1:完场, -2:待定,-3:中断,-4:取消,-5:推迟,50中场
                #region 获取状态
                if (id == p_id)
                {
                    if (Types == 0)
                    {
                        if (state == -1)
                        {
                            bf1 = Convert.ToInt32(Temp[11]);
                            bf2 = Convert.ToInt32(Temp[12]);
                        }
                    }
                    else if (Types == 1)
                    {
                        if (state > 1 || state == -1)
                        {
                            bf1 = Convert.ToInt32(Temp[13]);
                            bf2 = Convert.ToInt32(Temp[14]);
                        }
                    }
                    else if (Types == 2)
                    {
                        if (state > 2 || state == -1)
                        {
                            bf1 = Convert.ToInt32(Temp[15]);
                            bf2 = Convert.ToInt32(Temp[16]);
                        }
                    }
                    else if (Types == 3)
                    {
                        if (state > 2 || state == -1)
                        {
                            bf1 = Convert.ToInt32(Temp[13]) + Convert.ToInt32(Temp[15]);
                            bf2 = Convert.ToInt32(Temp[14]) + Convert.ToInt32(Temp[16]);
                        }
                    }
                    else if (Types == 4)
                    {
                        if ((state > 3 && state < 50) || state == -1)
                        {
                            bf1 = Convert.ToInt32(Temp[17]);
                            bf2 = Convert.ToInt32(Temp[18]);
                        }
                    }
                    break;
                }
                #endregion
            }
        }

        #region 开奖
        if (bf1 != -1 && bf2 != -1)
        {
            bool IsTrue = true;
            if (Types == 0 && bf1 == bf2)
            {
                IsTrue = false;
            }

            if (Types > 0 && bf1 == 0 && bf2 == 0)
            {
                IsTrue = false;
            }

            if (IsTrue)
            {
                TPR2.Model.guess.BaList model = new TPR2.Model.guess.BaList();
                model.p_id         = p_id;
                model.p_result_one = bf1;
                model.p_result_two = bf2;
                model.p_once       = "";
                model.p_active     = 1;
                model.p_basketve   = p_basketve;
                int upid = new TPR2.BLL.guess.BaList().UpdateZDResult2(model);
                if (upid > 0)
                {
                    //正常开奖
                    UpdateCase(bf1, bf2, ID, 2);
                }
            }
        }
        #endregion
    }
Exemplo n.º 7
0
    public void ReloadPage()
    {
        try
        {
            #region 获得半场和单节
            //获得半场和单节 http://vip.titan007.com/xmlvbs/fl_nbaGoal3.xml
            string str = new TPR2.Collec.BasketDJ().GetBasketDJ();
            #endregion

            if (str != "")
            {
                using (XmlReaderExtend reader = new XmlReaderExtend(str))
                {
                    while (reader.ReadToFollowing("m"))
                    {
                        string   p_str = reader.GetElementValue();
                        string[] Temp  = p_str.Split(',');
                        int      p_id  = Convert.ToInt32(Temp[0]);

                        #region 第一节盘口
                        //第一节盘口
                        try
                        {
                            decimal d1_pk       = Convert.ToDecimal(Temp[1]);
                            decimal d1_one_lu   = Convert.ToDecimal(Temp[2]);
                            decimal d1_two_lu   = Convert.ToDecimal(Temp[3]);
                            decimal d1_dx_pk    = Convert.ToDecimal(Temp[16]);
                            decimal d1_big_lu   = Convert.ToDecimal(Temp[17]);
                            decimal d1_small_lu = Convert.ToDecimal(Temp[18]);
                            AccessData(1, p_id, d1_pk, d1_dx_pk, d1_one_lu, d1_two_lu, d1_big_lu, d1_small_lu);
                        }
                        catch { }
                        #endregion

                        #region 第二节盘口
                        //第二节盘口
                        try
                        {
                            decimal d2_pk       = Convert.ToDecimal(Temp[4]);
                            decimal d2_one_lu   = Convert.ToDecimal(Temp[5]);
                            decimal d2_two_lu   = Convert.ToDecimal(Temp[6]);
                            decimal d2_dx_pk    = Convert.ToDecimal(Temp[19]);
                            decimal d2_big_lu   = Convert.ToDecimal(Temp[20]);
                            decimal d2_small_lu = Convert.ToDecimal(Temp[21]);
                            AccessData(2, p_id, d2_pk, d2_dx_pk, d2_one_lu, d2_two_lu, d2_big_lu, d2_small_lu);
                        }
                        catch { }
                        #endregion

                        #region 半场盘口
                        //半场盘口
                        try
                        {
                            decimal d3_pk       = Convert.ToDecimal(Temp[7]);
                            decimal d3_one_lu   = Convert.ToDecimal(Temp[8]);
                            decimal d3_two_lu   = Convert.ToDecimal(Temp[9]);
                            decimal d3_dx_pk    = Convert.ToDecimal(Temp[22]);
                            decimal d3_big_lu   = Convert.ToDecimal(Temp[23]);
                            decimal d3_small_lu = Convert.ToDecimal(Temp[24]);
                            AccessData(3, p_id, d3_pk, d3_dx_pk, d3_one_lu, d3_two_lu, d3_big_lu, d3_small_lu);
                        }
                        catch { }
                        #endregion

                        #region 第三节盘口
                        //第三节盘口
                        try
                        {
                            decimal d4_pk       = Convert.ToDecimal(Temp[10]);
                            decimal d4_one_lu   = Convert.ToDecimal(Temp[11]);
                            decimal d4_two_lu   = Convert.ToDecimal(Temp[12]);
                            decimal d4_dx_pk    = Convert.ToDecimal(Temp[25]);
                            decimal d4_big_lu   = Convert.ToDecimal(Temp[26]);
                            decimal d4_small_lu = Convert.ToDecimal(Temp[27]);
                            AccessData(4, p_id, d4_pk, d4_dx_pk, d4_one_lu, d4_two_lu, d4_big_lu, d4_small_lu);
                        }
                        catch { }
                        #endregion
                    }
                }

                //<m>156660,
                //-2.5,0.90,0.90,   第一节让分1,2,3
                //,,,               第二节让分4,5,6
                //-4.5,0.90,0.90,   半场让分7,8,9
                //,,,               第三节让分10,11,12
                //-9.5,0.90,0.90,   初盘让分13,14,15
                //44,0.88,0.88,     第一节总分16,17,18
                //,,,               第二节总分19,20,21
                //88.5,0.88,0.88,   半场总分22,23,24
                //,,,               第三节总分25,26,27
                //178.5,0.88,0.88   初盘总分 28,29,30
                //</m>
            }
        }
        catch { }
        Master.Title   = "采集单节赛事";
        Master.Refresh = 20;
        Master.Gourl   = Utils.getUrl("boCollec3.aspx");
        builder.Append("[" + DateTime.Now + "]更新成功");
    }
Exemplo n.º 8
0
        /// <summary>
        /// 处理足球让球盘XML
        /// </summary>
        /// <param name="p_html">HTML文档</param>
        private IList <TPR.Model.guess.BaList> FootHtml(string p_xml, out int p_recordCount)
        {
            IList <TPR.Model.guess.BaList> listFoots = new List <TPR.Model.guess.BaList>();

            p_recordCount = 0;
            try
            {
                using (XmlReaderExtend reader = new XmlReaderExtend(p_xml))
                {
                    while (reader.ReadToFollowing("m"))
                    {
                        TPR.Model.guess.BaList obj = new TPR.Model.guess.BaList();
                        obj.p_id      = Convert.ToInt32(reader.GetElementValue("i"));
                        obj.p_title   = reader.GetElementValue("le").Split(",".ToCharArray())[0];
                        obj.p_TPRtime = Convert.ToDateTime(reader.GetElementValue("t").Split(",".ToCharArray())[0]);
                        obj.p_one     = reader.GetElementValue("ta").Split(",".ToCharArray())[0];
                        obj.p_two     = reader.GetElementValue("tb").Split(",".ToCharArray())[0];
                        try
                        {
                            obj.p_pn = Convert.ToInt32(reader.GetElementValue("p").Split(",".ToCharArray())[0]);
                        }
                        catch
                        {
                            obj.p_pn = 1;
                        }
                        string[] saTemp = { };
                        saTemp = reader.GetElementValue("pl").Split(";".ToCharArray());
                        try
                        {
                            //SB:1/明升:9
                            if (Utils.GetTopDomain() == "tl88.cc" || Utils.GetTopDomain() == "168yy.cc")
                            {
                                obj.p_pk     = Convert.ToDecimal(saTemp[9].Split(",".ToCharArray())[1]);
                                obj.p_one_lu = Convert.ToDecimal(saTemp[9].Split(",".ToCharArray())[2]);
                                obj.p_two_lu = Convert.ToDecimal(saTemp[9].Split(",".ToCharArray())[3]);
                            }
                            else
                            {
                                obj.p_pk     = Convert.ToDecimal(saTemp[1].Split(",".ToCharArray())[1]);
                                obj.p_one_lu = Convert.ToDecimal(saTemp[1].Split(",".ToCharArray())[2]);
                                obj.p_two_lu = Convert.ToDecimal(saTemp[1].Split(",".ToCharArray())[3]);
                            }
                        }
                        catch
                        {
                            obj.p_pk     = 0;
                            obj.p_one_lu = 0;
                            obj.p_two_lu = 0;
                        }

                        listFoots.Add(obj);
                        p_recordCount++;
                    }

                    return(listFoots);
                }
            }
            catch
            {
                return(null);
            }
        }