Exemple #1
0
        private void cur_trem()//调用当前开奖记录
        {
            string          str      = null;
            HttpWebResponse response = null;
            StreamReader    reader   = null;

            //nowdate = DateTime.Now;
            //if (nowdate.Hour < 2)
            //{
            //    nowdate = nowdate.Subtract(TimeSpan.FromDays(1));
            //}

            try
            {
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://t.apiplus.cn/daily.do?code=xjssc&format=json");;
                request.Method  = "GET";
                request.Timeout = 10000;
                response        = (HttpWebResponse)request.GetResponse();
                reader          = new StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("UTF-8"));
                str             = reader.ReadToEnd();
                str             = str.Substring(str.IndexOf('['), str.Length - str.IndexOf('[') - 1);
                JArray jsonstr = JArray.Parse(str);

                //foreach (var c in jsonstr)
                //{
                //    int u;
                //}


                for (int i = 0; i < jsonstr.Count; i++)
                {
                    int curjson_count = (from c in PublicClass.XinjiangJson where c["expect"].ToString() == jsonstr[i]["expect"].ToString() select c).Count();
                    if (curjson_count == 0)
                    {
                        PublicClass.XinjiangJson.Add(jsonstr[i]);

                        Dispatcher.Invoke(new Action(delegate
                        {
                            tremlist newtrem = MainWindow.FindChild <tremlist>(Application.Current.MainWindow, "newtrem");
                            if (newtrem != null)
                            {
                                //newtrem.tr
                                newtrem.cul_list(nowdate.ToLongDateString(), "xj");
                            }
                        }));

                        modify_last_update_time();
                        UI_process();
                        create_danshuang_lab();
                        create_lianxu_coor();
                    }
                }
            }
            catch
            {
            }
        }
Exemple #2
0
        private void init_trem()//调用当日全部开奖记录
        {
            string          str      = null;
            HttpWebResponse response = null;
            StreamReader    reader   = null;

            //DateTime nowdate = DateTime.Now;
            nowdate = DateTime.Now;
            HttpWebRequest request = null;

            for (int i = 0; i < 10; i++)
            {
                try
                {
                    request         = (HttpWebRequest)WebRequest.Create("http://t.apiplus.cn/daily.do?code=cqssc&date=" + nowdate + "&format=json");
                    request.Method  = "GET";
                    request.Timeout = 5000;
                    response        = (HttpWebResponse)request.GetResponse();
                    i = 10;
                }
                catch { }
            }


            reader = new StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("UTF-8"));
            str    = reader.ReadToEnd();
            str    = str.Substring(str.IndexOf('['), str.Length - str.IndexOf('[') - 1);
            JArray jsonstr = JArray.Parse(str);

            //foreach (var c in jsonstr)
            //{
            //    int u;
            //}


            for (int i = jsonstr.Count - 1; i >= 0; i--)
            {
                PublicClass.ChongqingJson.Add(jsonstr[i]);
            }
            UI_process();
            create_danshuang_lab();
            create_lianxu_coor();



            tremlist newtrem = MainWindow.FindChild <tremlist>(Application.Current.MainWindow, "newtrem");

            if (newtrem != null)
            {
                //newtrem.tr
                newtrem.cul_list(DateTime.Now.ToLongDateString(), "cq");
            }
            modify_last_update_time();
            timer.Start();
        }
Exemple #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //chongqing newchongqing = new chongqing();
            //LayoutDocument cq = new LayoutDocument();
            //cq.Content = newchongqing;
            //cq.Title = "重庆时时彩";
            //avapane.Children.Add(cq);

            //xinjiang newxinjiang = new xinjiang();
            //LayoutDocument xj = new LayoutDocument();
            //xj.Content = newxinjiang;
            //xj.Title = "新疆时时彩";
            //avapane.Children.Add(xj);

            tremlist newtrem = new tremlist();

            newtrem.Name      = "newtrem";
            leftpanel.Content = newtrem;


            rightlianxu rightcq = new rightlianxu();

            rightcq.Name = "rightcq";
            rightcq.titlelable.Content = "重庆时时彩";
            //rightpanel.Content = rightcq;
            rightstack.Children.Add(rightcq);

            //rightlianxu rightxj = new rightlianxu();
            //rightxj.Name = "rightxj";
            //rightxj.titlelable.Content = "新疆时时彩";
            ////rightpanel.Content = rightxj;
            //rightstack.Children.Add(rightxj);

            sub_chongqing chongqing = new sub_chongqing();

            chongqing.Name = "chongqing";
            LayoutDocument cq = new LayoutDocument();

            cq.Content = chongqing;
            cq.Title   = "重庆时时彩";
            avapane.Children.Add(cq);



            timer.Interval = 1000;
            timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
            //init_trem();
            PublicClass.init_trem("cqssc");
            create_lianxu_coor("cqssc");
            timer.Start();
        }
Exemple #4
0
        private void cur_trem()//调用当前开奖记录
        {
            Dispatcher.Invoke(new Action(delegate
            {
                tremlist newtrem = MainWindow.FindChild <tremlist>(Application.Current.MainWindow, "newtrem");
                if (newtrem != null)
                {
                    newtrem.cul_list(DateTime.Now.ToLongDateString(), "cq");
                }
            }));

            try
            {
                UI_process();
                create_danshuang_lab();
                create_longhu_lab();
                create_lianxu_coor();
            }
            catch
            {
            }
        }