Exemplo n.º 1
0
        private void btnGet_Click(object sender, EventArgs e)
        {
            if (txtUrl.Text.Trim() == "")
            {
                return;
            }

            string[] strs     = txtUrl.Text.Trim().Split(',');
            string[] openInfo = Data_get.getOpenCode(strs[0], (strs.Length > 1 ? strs[1] : ""), 1);

            updateUI(openInfo);
        }
Exemplo n.º 2
0
        private void timerElapseHandler(object sender, System.Timers.ElapsedEventArgs e)
        {
            timeCount     += (int)(intervalTimer.Interval / 1000);
            timeCountPK10 += (int)(intervalTimer.Interval / 1000);

            if (timeCount >= timeWait)
            {
                timeCount = 0;

                if (openInfo[1] != null)
                {
                    peroid = Convert.ToInt32(openInfo[0].Substring(0, 6) + openInfo[0].Substring(7, 3)) + 1;
                    if (DateTime.Now.Hour == 0 && openInfo[0].Substring(7, 3) == "120")
                    {
                        peroid = Convert.ToInt32(DateTime.Now.ToString("yyMMdd") + "001");
                    }
                    strPeroid = peroid.ToString().Substring(0, 6) + "-" + peroid.ToString().Substring(6, 3);
                }

                string[] temp = Data_get.getOpenCode("cqssc", strPeroid, 1);

                timeWait = getWaitTime(openInfo[2]);

                if ((openInfo != null && openInfo[0] != temp[0]) ||
                    openInfo == null)
                {
                    openInfo = temp;

                    updateUI(openInfo);
                }

                if (timeWait > 605)
                {
                    DateTime dt = DateTime.Parse("00:00:00").AddSeconds(timeWait);
                    updateUI(new string[] { "CQSSC Newday's Open Will Wait " + dt.Hour + " Hour " + dt.Minute + " Min " + dt.Second + " Sec" });
                }
            }


            if (timeCountPK10 >= timeWaitPK10)
            {
                timeCountPK10 = 0;

                if (openInfoPK10[1] != null)
                {
                    peroidPK10    = Convert.ToInt32(openInfoPK10[0]) + 1;
                    strPeroidPK10 = peroidPK10.ToString();
                }

                string[] temp = Data_get.getOpenCode("bjpk10", strPeroidPK10, 1);

                timeWaitPK10 = getWaitTimePK10(openInfoPK10[2]);

                if ((openInfoPK10 != null && openInfoPK10[0] != temp[0]) ||
                    openInfoPK10 == null)
                {
                    openInfoPK10 = temp;

                    updateUI(openInfoPK10);
                }

                if (timeWaitPK10 > 305)
                {
                    DateTime dt = DateTime.Parse("00:00:00").AddSeconds(timeWaitPK10);
                    updateUI(new string[] { "BJPK10 Newday's Open Will Wait " + dt.Hour + " Hour " + dt.Minute + " Min " + dt.Second + " Sec" });
                }
            }
        }