Ejemplo n.º 1
0
        /// <summary>
        /// 最终生成
        /// </summary>
        /// <param name="li">传入List<string>结果</param>
        private void generateData(List <string> li)
        {
            string ans = "";

            for (int i = 0; i < li.Count(); i++)
            {
                ans += li[i];
            }
            ans = ans.Substring(0, ans.Length - 1);

            try { otForm.Text = "共计  " + li.Count + "   注 - 恩泽天下"; otForm.textBox1.Text = ans; }
            catch { otForm.Text = "出错"; otForm.textBox1.Text = "运算出错,请您检查您设置的条件!"; }
            otForm.Show();
        }
Ejemplo n.º 2
0
        //直选转组选
        private void zhiXuanZhuanZuXuan()
        {
            string        answer = this.textBox1.Text;
            List <string> li     = new List <string>();

            //根据form1的分隔符下拉框来分割
            string txt = Global.splitRegex;

            //MessageBox.Show("[" + f1.comboBox1.Text + "],[" + txt + "]");
            string[] answersLine = Regex.Split(answer, txt, RegexOptions.IgnoreCase);

            if (answersLine.Length > 0)
            {
                for (int i = 0; i < answersLine.Length; i++)
                {
                    string _answer = answersLine[i];
                    int    a       = Int32.Parse(_answer.Substring(0, 1));
                    int    b       = Int32.Parse(_answer.Substring(1, 1));
                    int    c       = Int32.Parse(_answer.Substring(2, 1));
                    int    temp    = 0;
                    if (a > b)
                    {
                        temp = a;
                        a    = b;
                        b    = temp;
                    }
                    if (b > c)
                    {
                        temp = c;
                        c    = b;
                        if (temp > a)
                        {
                            b = temp;
                        }
                        else
                        {
                            b = a;
                            a = temp;
                        }
                    }
                    _answer = a + "" + b + "" + c + "";
                    li.Add(_answer + txt);
                }
                li = li.Distinct().ToList();
            }

            string ans = "";

            string[] allNum = li.ToArray();

            /* int countNums = 1;
             * int whereEnter = 22;
             * if(txt.Equals(",")||txt.Equals(";")){
             *   whereEnter = 16;
             * }
             * for (int i = 0; i < allNum.Count(); i++)
             * {
             *   string _allNum = allNum[i];
             *   if (countNums == whereEnter)
             *   {
             *       _allNum += Environment.NewLine;//"\r\n"+
             *       countNums = 0;
             *   }
             *   ans += _allNum;
             *   countNums++;
             * }
             * ans = ans.Trim();
             * if(!IsNumber(ans.Substring(ans.Length-1,1))){
             *   ans=ans.Substring(0, ans.Length - 1);
             * }*/
            for (int i = 0; i < allNum.Count(); i++)
            {
                ans += allNum[i];
            }

            try { f2.Text = "共计  " + (ans.Length / 4).ToString() + "   注,当前运算结果为 时时彩 - 3D - 排列三 - 快乐3 - 时时乐"; f2.textBox1.Text = ans.Substring(0, ans.Length - 1); }
            catch { f2.Text = "出错"; f2.textBox1.Text = "运算出错,请您检查您设置的条件!"; }
            f2.Show();
        }