用C#開發的雙色球走勢圖(二)

        昨晚因爲時間的緣由只寫了一部份內容,今天將這一部份內容補充完畢,多謝各位園友的支持。html

        這是用C#開發的雙色球走勢圖(一)新的園友能夠看昨晚寫的內容,以避免脫節。首先回復園友的評論,有說好的有說很差的,本人無論你說好仍是很差,根本不影響我的寫這篇博客,寫這篇博客主要目的仍是與你們交流技術,僅供交流和學習,本人花在這上面的時間的大楷也就是一個星期的晚上時間(星期一到星期五晚上)和週末(週六週日)的時間而已,並無花費更多的時間;關於公佈源碼的問題,本人會在稍後公佈,因爲如今個人源碼集成在個人一個項目裏,因此不方便公佈,一旦我把這個模塊分離出來,會公佈源碼以供你們交流和學習,希各位繼續支持和關注。還有就是這個程序純粹我的好玩,不能預測開獎號碼,不過這些分析數據能夠供你們購買彩票以前的參考,我以爲還能夠。ide

        以上爲題外話,如今言歸正傳,繼續介紹紅球四分區走勢圖。post

3.紅球四分區走勢圖學習

首先呈上效果圖:this

 

不帶遺漏數據的走勢圖:spa

貼上四分區走勢圖的源碼:code

  1       #region * 紅球四分區走勢圖  2 /// <summary>  3 /// 紅球四分區走勢圖  4 /// </summary>  5 /// <param name="obj"></param>  6 private void GetData3(object obj)  7  {  8  fourredtable.Clear();  9  fourcleanredtable.Clear();  10 if (listWinNo != null && listWinNo.Count > 0)  11  {  12 foreach (WinNo item in listWinNo)  13  {  14 List<int> redList = new List<int>();  15  redList.Add(item.R1);  16  redList.Add(item.R2);  17  redList.Add(item.R3);  18  redList.Add(item.R4);  19  redList.Add(item.R5);  20  redList.Add(item.R6);  21 //--  22 DataRow reddr =fourredtable.NewRow();  23 reddr["QiHao"] = item.QiHao;  24 reddr["R" + item.R1] = "R" + GetStr(item.R1.ToString());//紅1  25 reddr["R" + item.R2] = "R" + GetStr(item.R2.ToString());//紅2  26 reddr["R" + item.R3] = "R" + GetStr(item.R3.ToString());//紅3  27 reddr["R" + item.R4] = "R" + GetStr(item.R4.ToString());//紅4  28 reddr["R" + item.R5] = "R" + GetStr(item.R5.ToString());//紅5  29 reddr["R" + item.R6] = "R" + GetStr(item.R6.ToString());//紅6  30 reddr["C1"] = GetFourFenQu(redList)[0];  31 reddr["C2"] = GetFourFenQu(redList)[1];  32 reddr["C3"] = GetFourFenQu(redList)[2];  33 reddr["C4"] = GetFourFenQu(redList)[3];  34  fourredtable.Rows.Add(reddr);  35  36 DataRow cleanreddr =fourcleanredtable.NewRow();  37 cleanreddr["QiHao"] = item.QiHao;  38 cleanreddr["R" + item.R1] = GetStr(item.R1.ToString());//紅1  39 cleanreddr["R" + item.R2] = GetStr(item.R2.ToString());//紅2  40 cleanreddr["R" + item.R3] = GetStr(item.R3.ToString());//紅3  41 cleanreddr["R" + item.R4] = GetStr(item.R4.ToString());//紅4  42 cleanreddr["R" + item.R5] = GetStr(item.R5.ToString());//紅5  43 cleanreddr["R" + item.R6] = GetStr(item.R6.ToString());//紅6  44 cleanreddr["C1"] = GetFourFenQu(redList)[0];  45 cleanreddr["C2"] = GetFourFenQu(redList)[1];  46 cleanreddr["C3"] = GetFourFenQu(redList)[2];  47 cleanreddr["C4"] = GetFourFenQu(redList)[3];  48  fourcleanredtable.Rows.Add(cleanreddr);  49  }  50  51 for (int j = 1; j < 34; j++)  52  {  53 int xint = 0;  54 for (int i = 0; i < fourredtable.Rows.Count; i++)  55  {  56 if (string.IsNullOrEmpty(fourredtable.Rows[i]["R" + j].ToString()))  57  {  58 xint++;  59 fourredtable.Rows[i]["R" + j] = xint;  60  }  61 else  62  {  63 xint = 0;  64  }  65  }  66  }  67  68 if (this.IsHandleCreated)  69  {  70 this.Invoke((MethodInvoker)delegate  71  {  72 if (flag)  73  {  74 fourcleanredtable.DefaultView.Sort = "QiHao DESC";  75 this.gridControl3.DataSource = fourcleanredtable.DefaultView.ToTable();  76  }  77 else  78  {  79 fourredtable.DefaultView.Sort = "QiHao DESC";  80 this.gridControl3.DataSource = fourredtable.DefaultView.ToTable();  81  }  82  });  83  }  84  }  85  }  86  87 /// <summary>  88 /// 四分區個數  89 /// </summary>  90 /// <param name="redList"></param>  91 /// <returns></returns>  92 private List<string> GetFourFenQu(List<int> redList)  93  {  94 List<string> retlist = new List<string>();  95 int xint1 = 0;  96 int xint2 = 0;  97 int xint3 = 0;  98 int xint4 = 0;  99 foreach (int item in redList) 100  { 101 if (item < 9) 102  { 103 xint1++; 104  } 105 else if (item > 8 && item <= 17) 106  { 107 xint2++; 108  } 109 else if (item > 17 && item < 26) 110  { 111 xint3++; 112  } 113 else if (item > 25) 114  { 115 xint4++; 116  } 117  } 118  retlist.Add(xint1.ToString()); 119  retlist.Add(xint2.ToString()); 120  retlist.Add(xint3.ToString()); 121  retlist.Add(xint4.ToString()); 122 return retlist; 123  } 124 #endregion
View Code

 

4.紅球七分區走勢圖htm

 七分區走勢圖效果圖:blog

不帶遺漏數據的走勢圖:ci

貼上七分區走勢圖的源碼:

  1    #region * 紅球七分區走勢圖  2 /// <summary>  3 /// 紅球七分區走勢圖  4 /// </summary>  5 /// <param name="obj"></param>  6 private void GetData4(object obj)  7  {  8  sevenredtable.Clear();  9  sevencleanredtable.Clear();  10 if (listWinNo != null && listWinNo.Count > 0)  11  {  12 foreach (WinNo item in listWinNo)  13  {  14 List<int> redList = new List<int>();  15  redList.Add(item.R1);  16  redList.Add(item.R2);  17  redList.Add(item.R3);  18  redList.Add(item.R4);  19  redList.Add(item.R5);  20  redList.Add(item.R6);  21 //--  22 DataRow reddr = sevenredtable.NewRow();  23 reddr["QiHao"] = item.QiHao;  24 reddr["R" + item.R1] = "R" + GetStr(item.R1.ToString());//紅1  25 reddr["R" + item.R2] = "R" + GetStr(item.R2.ToString());//紅2  26 reddr["R" + item.R3] = "R" + GetStr(item.R3.ToString());//紅3  27 reddr["R" + item.R4] = "R" + GetStr(item.R4.ToString());//紅4  28 reddr["R" + item.R5] = "R" + GetStr(item.R5.ToString());//紅5  29 reddr["R" + item.R6] = "R" + GetStr(item.R6.ToString());//紅6  30 reddr["D1"] = GetSevenFenQu(redList)[0];  31 reddr["D2"] = GetSevenFenQu(redList)[1];  32 reddr["D3"] = GetSevenFenQu(redList)[2];  33 reddr["D4"] = GetSevenFenQu(redList)[3];  34 reddr["D5"] = GetSevenFenQu(redList)[4];  35 reddr["D6"] = GetSevenFenQu(redList)[5];  36 reddr["D7"] = GetSevenFenQu(redList)[6];  37  sevenredtable.Rows.Add(reddr);  38  39 DataRow cleanreddr = sevencleanredtable.NewRow();  40 cleanreddr["QiHao"] = item.QiHao;  41 cleanreddr["R" + item.R1] = GetStr(item.R1.ToString());//紅1  42 cleanreddr["R" + item.R2] = GetStr(item.R2.ToString());//紅2  43 cleanreddr["R" + item.R3] = GetStr(item.R3.ToString());//紅3  44 cleanreddr["R" + item.R4] = GetStr(item.R4.ToString());//紅4  45 cleanreddr["R" + item.R5] = GetStr(item.R5.ToString());//紅5  46 cleanreddr["R" + item.R6] = GetStr(item.R6.ToString());//紅6  47 cleanreddr["D1"] = GetSevenFenQu(redList)[0];  48 cleanreddr["D2"] = GetSevenFenQu(redList)[1];  49 cleanreddr["D3"] = GetSevenFenQu(redList)[2];  50 cleanreddr["D4"] = GetSevenFenQu(redList)[3];  51 cleanreddr["D5"] = GetSevenFenQu(redList)[4];  52 cleanreddr["D6"] = GetSevenFenQu(redList)[5];  53 cleanreddr["D7"] = GetSevenFenQu(redList)[6];  54  sevencleanredtable.Rows.Add(cleanreddr);  55  }  56  57 for (int j = 1; j <34; j++)  58  {  59 int xint = 0;  60 for (int i = 0; i < sevenredtable.Rows.Count; i++)  61  {  62 if (string.IsNullOrEmpty(sevenredtable.Rows[i]["R" + j].ToString()))  63  {  64 xint++;  65 sevenredtable.Rows[i]["R" + j] = xint;  66  }  67 else  68  {  69 xint = 0;  70  }  71  }  72  }  73  74 if (this.IsHandleCreated)  75  {  76 this.Invoke((MethodInvoker)delegate  77  {  78 if (flag)  79  {  80 sevencleanredtable.DefaultView.Sort = "QiHao DESC";  81 this.gridControl4.DataSource = sevencleanredtable.DefaultView.ToTable();  82  }  83 else  84  {  85 sevenredtable.DefaultView.Sort = "QiHao DESC";  86 this.gridControl4.DataSource = sevenredtable.DefaultView.ToTable();  87  }  88  });  89  }  90  }  91  }  92  93 private List<string> GetSevenFenQu(List<int> redList)  94  {  95 List<string> retlist = new List<string>();  96 int xint1 = 0;  97 int xint2 = 0;  98 int xint3 = 0;  99 int xint4 = 0; 100 int xint5 = 0; 101 int xint6 = 0; 102 int xint7 = 0; 103 foreach (int item in redList) 104  { 105 if (item < 6) 106  { 107 xint1++; 108  } 109 else if (item > 5 && item < 11) 110  { 111 xint2++; 112  } 113 else if (item > 10 && item < 16) 114  { 115 xint3++; 116  } 117 else if (item > 15 && item < 21) 118  { 119 xint4++; 120  } 121 else if (item > 20 && item < 26) 122  { 123 xint5++; 124  } 125 else if (item > 25 && item < 31) 126  { 127 xint6++; 128  } 129 else if (item > 30 && item < 34) 130  { 131 xint7++; 132  } 133  } 134  retlist.Add(xint1.ToString()); 135  retlist.Add(xint2.ToString()); 136  retlist.Add(xint3.ToString()); 137  retlist.Add(xint4.ToString()); 138  retlist.Add(xint5.ToString()); 139  retlist.Add(xint6.ToString()); 140  retlist.Add(xint7.ToString()); 141 return retlist; 142  } 143 #endregion
View Code

 

5.紅球連號走勢圖

 連號走勢圖效果圖:

不帶遺漏數據的效果圖:

貼上連號走勢圖的源碼:

  1     #region * 紅球連號走勢圖  2 /// <summary>  3 /// 紅球連號走勢圖  4 /// </summary>  5 /// <param name="obj"></param>  6 private void GetData6(object obj)  7  {  8  lianhaotable.Clear();  9  lianhaocleantable.Clear();  10 if (listWinNo != null && listWinNo.Count > 0)  11  {  12 foreach (WinNo item in listWinNo)  13  {  14 List<int> redList = new List<int>();  15  redList.Add(item.R1);  16  redList.Add(item.R2);  17  redList.Add(item.R3);  18  redList.Add(item.R4);  19  redList.Add(item.R5);  20  redList.Add(item.R6);  21 //--  22 DataRow reddr = lianhaotable.NewRow();  23 DataRow cleanreddr = lianhaocleantable.NewRow();  24 reddr["QiHao"] = item.QiHao;  25 cleanreddr["QiHao"] = item.QiHao;  26 reddr["R"] = GetStr(item.R1.ToString()) + " " + GetStr(item.R2.ToString()) + " " + GetStr(item.R3.ToString()) + " " + GetStr(item.R4.ToString()) + " " + GetStr(item.R5.ToString()) + " " + GetStr(item.R6.ToString());  27 cleanreddr["R"] = GetStr(item.R1.ToString()) + " " + GetStr(item.R2.ToString()) + " " + GetStr(item.R3.ToString()) + " " + GetStr(item.R4.ToString()) + " " + GetStr(item.R5.ToString()) + " " + GetStr(item.R6.ToString());  28 //--  29 List<string> list = new List<string>();  30 list = GetList(redList);  31 int group = 0;  32 if (list != null && list.Count > 0)  33  {  34 foreach (string strlist in list)  35  {  36 string[] arr = strlist.Split(",".ToCharArray());  37 group += arr.Count() - 1;  38 foreach (string code in arr)  39  {  40 reddr["R" + code] = "R" + GetStr(code);  41 cleanreddr["R" + code] = GetStr(code);  42  }  43  }  44  }  45 reddr["A"] = list.Count();  46 cleanreddr["A"] = list.Count();  47 reddr["B"] = group.ToString();  48 cleanreddr["B"] = group.ToString();  49 //--  50  lianhaotable.Rows.Add(reddr);  51  lianhaocleantable.Rows.Add(cleanreddr);  52  }  53  54 for (int j = 1; j < 34; j++)  55  {  56 int xint = 0;  57 for (int i = 0; i < lianhaotable.Rows.Count; i++)  58  {  59 if (string.IsNullOrEmpty(lianhaotable.Rows[i]["R" + j].ToString()))  60  {  61 xint++;  62 lianhaotable.Rows[i]["R" + j] = xint;  63  }  64 else  65  {  66 xint = 0;  67  }  68  }  69  }  70  71 if (this.IsHandleCreated)  72  {  73 this.Invoke((MethodInvoker)delegate  74  {  75 if (flag)  76  {  77 lianhaocleantable.DefaultView.Sort = "QiHao DESC";  78 this.gridControl6.DataSource = lianhaocleantable.DefaultView.ToTable();  79  }  80 else  81  {  82 lianhaotable.DefaultView.Sort = "QiHao DESC";  83 this.gridControl6.DataSource = lianhaotable.DefaultView.ToTable();  84  }  85  });  86  }  87  }  88  }  89  90 /// <summary>  91 /// 計算連號  92 /// </summary>  93 /// <param name="RedCode"></param>  94 /// <returns></returns>  95 private List<string> GetList(List<int> RedCode)  96  {  97 List<string> retlist = new List<string>();  98 for (int i = 0; i < RedCode.Count; i++)  99  { 100 string retstr = string.Empty; 101 if (i < 5) 102  { 103 if (RedCode[i + 1] - RedCode[i] == 1)//兩連號 104  { 105 retstr = RedCode[i] + "," + RedCode[i + 1]; 106  } 107  } 108 if (i < 4) 109  { 110 if (RedCode[i + 2] - RedCode[i + 1] == 1 && RedCode[i + 1] - RedCode[i] == 1)//三連號 111  { 112 retstr = RedCode[i] + "," + RedCode[i + 1] + "," + RedCode[i + 2]; 113  } 114  } 115 if (i < 3) 116  { 117 if (RedCode[i + 3] - RedCode[i + 2] == 1 && RedCode[i + 2] - RedCode[i + 1] == 1 && RedCode[i + 1] - RedCode[i] == 1)//四連號 118  { 119 retstr = RedCode[i] + "," + RedCode[i + 1] + "," + RedCode[i + 2] + "," + RedCode[i + 3]; 120  } 121  } 122 if (i < 2) 123  { 124 if (RedCode[i + 4] - RedCode[i + 3] == 1 && RedCode[i + 3] - RedCode[i + 2] == 1 && RedCode[i + 2] - RedCode[i + 1] == 1 && RedCode[i + 1] - RedCode[i] == 1)//五連號 125  { 126 retstr = RedCode[i] + "," + RedCode[i + 1] + "," + RedCode[i + 2] + "," + RedCode[i + 3] + "," + RedCode[i + 4]; 127  } 128  } 129 if (!string.IsNullOrEmpty(retstr)) 130  { 131 if (retlist != null && retlist.Count > 0) 132  { 133 var tmp = from c in retlist 134 where ("," + c + ",").Contains("," + retstr + ",") 135 select c; 136 if (tmp.Count() == 0) 137  { 138  retlist.Add(retstr); 139  } 140  } 141 else 142  { 143  retlist.Add(retstr); 144  } 145  } 146  } 147 return retlist; 148  } 149 #endregion
View Code

 

6.和值走勢圖

和值走勢圖效果圖:

不帶遺漏數據的效果圖:

貼上和值走勢圖的源碼:

  1      #region * 紅球和值走勢圖  2 /// <summary>  3 /// 紅球和值走勢圖  4 /// </summary>  5 /// <param name="obj"></param>  6 private void GetData7(object obj)  7  {  8  hezhitable.Clear();  9  hezhicleantable.Clear();  10 if (listWinNo != null && listWinNo.Count > 0)  11  {  12 foreach (WinNo item in listWinNo)  13  {  14 DataRow reddr = hezhitable.NewRow();  15 DataRow cleanreddr = hezhicleantable.NewRow();  16 reddr["QiHao"] = item.QiHao;  17 cleanreddr["QiHao"] = item.QiHao;  18 reddr["R"] = GetStr(item.R1.ToString()) + " " + GetStr(item.R2.ToString()) + " " + GetStr(item.R3.ToString()) + " " + GetStr(item.R4.ToString()) + " " + GetStr(item.R5.ToString()) + " " + GetStr(item.R6.ToString());  19 cleanreddr["R"] = GetStr(item.R1.ToString()) + " " + GetStr(item.R2.ToString()) + " " + GetStr(item.R3.ToString()) + " " + GetStr(item.R4.ToString()) + " " + GetStr(item.R5.ToString()) + " " + GetStr(item.R6.ToString());  20 decimal total = item.R1 + item.R2 + item.R3 + item.R4 + item.R5 + item.R6;  21 reddr["TOTAL"] = total;  22 cleanreddr["TOTAL"] = total;  23 //--  24 string r1 = total > 20 && total < 61 ? total.ToString() : "";  25 string r2 = total > 60 && total < 71 ? total.ToString() : "";  26 string r3 = total > 70 && total < 81 ? total.ToString() : "";  27 string r4 = total > 80 && total < 91 ? total.ToString() : "";  28 string r5 = total > 90 && total < 101 ? total.ToString() : "";  29 string r6 = total > 100 && total < 111 ? total.ToString() : "";  30 string r7 = total > 110 && total < 121 ? total.ToString() : "";  31 string r8 = total > 120 && total < 131 ? total.ToString() : "";  32 string r9 = total > 130 && total < 141 ? total.ToString() : "";  33 string r10 = total > 140 && total < 151 ? total.ToString() : "";  34 string r11 = total > 150 && total < 161 ? total.ToString() : "";  35 string r12 = total > 160 && total < 184 ? total.ToString() : "";  36 string w = total.ToString().Substring(total.ToString().Length - 1, 1);  37 //--  38 reddr["R1"] = !string.IsNullOrEmpty(r1) ? "R" + r1 : "";  39 reddr["R2"] = !string.IsNullOrEmpty(r2) ? "R" + r2 : "";  40 reddr["R3"] = !string.IsNullOrEmpty(r3) ? "R" + r3 : "";  41 reddr["R4"] = !string.IsNullOrEmpty(r4) ? "R" + r4 : "";  42 reddr["R5"] = !string.IsNullOrEmpty(r5) ? "R" + r5 : "";  43 reddr["R6"] = !string.IsNullOrEmpty(r6) ? "R" + r6 : "";  44 reddr["R7"] = !string.IsNullOrEmpty(r7) ? "R" + r7 : "";  45 reddr["R8"] = !string.IsNullOrEmpty(r8) ? "R" + r8 : "";  46 reddr["R9"] = !string.IsNullOrEmpty(r9) ? "R" + r9 : "";  47 reddr["R10"] = !string.IsNullOrEmpty(r10) ? "R" + r10 : "";  48 reddr["R11"] = !string.IsNullOrEmpty(r11) ? "R" + r11 : "";  49 reddr["R12"] = !string.IsNullOrEmpty(r12) ? "R" + r12 : "";  50 reddr["W"] = w;  51 reddr["W"+w] ="W"+ w;  52 //--  53 cleanreddr["R1"] = r1;  54 cleanreddr["R2"] = r2;  55 cleanreddr["R3"] = r3;  56 cleanreddr["R4"] = r4;  57 cleanreddr["R5"] = r5;  58 cleanreddr["R6"] = r6;  59 cleanreddr["R7"] = r7;  60 cleanreddr["R8"] = r8;  61 cleanreddr["R9"] = r9;  62 cleanreddr["R10"] = r10;  63 cleanreddr["R11"] = r11;  64 cleanreddr["R12"] = r12;  65 cleanreddr["W"] = w;  66 cleanreddr["W" + w] = w;  67 //--  68  hezhitable.Rows.Add(reddr);  69  hezhicleantable.Rows.Add(cleanreddr);  70  }  71  72 for (int j = 1; j < 13; j++)  73  {  74 int xint = 0;  75 for (int i = 0; i < hezhitable.Rows.Count; i++)  76  {  77 if (string.IsNullOrEmpty(hezhitable.Rows[i]["R" + j].ToString()))  78  {  79 xint++;  80 hezhitable.Rows[i]["R" + j] = xint;  81  }  82 else  83  {  84 xint = 0;  85  }  86  }  87  }  88  89 for (int j = 0; j < 10; j++)  90  {  91 int xint = 0;  92 for (int i = 0; i < hezhitable.Rows.Count; i++)  93  {  94 if (string.IsNullOrEmpty(hezhitable.Rows[i]["W" + j].ToString()))  95  {  96 xint++;  97 hezhitable.Rows[i]["W" + j] = xint;  98  }  99 else 100  { 101 xint = 0; 102  } 103  } 104  } 105 106 if (this.IsHandleCreated) 107  { 108 this.Invoke((MethodInvoker)delegate 109  { 110 if (flag) 111  { 112 hezhicleantable.DefaultView.Sort = "QiHao DESC"; 113 this.gridControl7.DataSource = hezhicleantable.DefaultView.ToTable(); 114  } 115 else 116  { 117 hezhitable.DefaultView.Sort = "QiHao DESC"; 118 this.gridControl7.DataSource = hezhitable.DefaultView.ToTable(); 119  } 120  }); 121  } 122  } 123  } 124 #endregion
View Code

 

7.籃球綜合走勢圖

籃球綜合走勢圖效果圖:

不帶遺漏數據的效果圖:

貼上籃球綜合走勢圖的源碼: 

  1        #region * 籃球綜合走勢圖  2 /// <summary>  3 /// 籃球綜合走勢圖  4 /// </summary>  5 /// <param name="obj"></param>  6 private void GetData5(object obj)  7  {  8  buletable.Clear();  9  bulecleantable.Clear();  10 if (listWinNo != null && listWinNo.Count > 0)  11  {  12 foreach (WinNo item in listWinNo)  13  {  14 DataRow buledr = buletable.NewRow();  15 buledr["QiHao"] = item.QiHao;  16 buledr["R"] = GetStr(item.R1.ToString()) + " " + GetStr(item.R2.ToString()) + " " + GetStr(item.R3.ToString()) + " " + GetStr(item.R4.ToString()) + " " + GetStr(item.R5.ToString()) + " " + GetStr(item.R6.ToString());  17 buledr["B"] = GetStr(item.B.ToString());  18 buledr["B" + item.B] = "B" + GetStr(item.B.ToString());//籃球  19 buledr["X1"] = GetDa(item.B);// 20 buledr["X2"] = GetXiao(item.B);// 21 buledr["X3"] = GetJiShu(item.B);// 22 buledr["X4"] = GetOShu(item.B);// 23 buledr["X5"] = GetZhiShu(item.B);// 24 buledr["X6"] = GetHeShu(item.B);// 25 buledr["X7"] = GetFenQu1(item.B);//一區  26 buledr["X8"] = GetFenQu2(item.B);//二區  27 buledr["X9"] = GetFenQu3(item.B);//三區  28 buledr["X10"] = GetFenQu4(item.B);//四區  29 buledr["X11"] = GetWeiShu(item.B);//尾數  30 buledr["X12"] = GetWeiShuQuJian(item.B, 0);//0-1  31 buledr["X13"] = GetWeiShuQuJian(item.B, 2);//2-3  32 buledr["X14"] = GetWeiShuQuJian(item.B, 4);//4-5  33 buledr["X15"] = GetWeiShuQuJian(item.B, 6);//6-7  34 buledr["X16"] = GetWeiShuQuJian(item.B, 8);//8-9  35  buletable.Rows.Add(buledr);  36 //--  37 DataRow bulecleandr =bulecleantable.NewRow();  38 bulecleandr["QiHao"] = item.QiHao;  39 bulecleandr["R"] = GetStr(item.R1.ToString()) + " " + GetStr(item.R2.ToString()) + " " + GetStr(item.R3.ToString()) + " " + GetStr(item.R4.ToString()) + " " + GetStr(item.R5.ToString()) + " " + GetStr(item.R6.ToString());  40 bulecleandr["B"] = GetStr(item.B.ToString());  41 bulecleandr["B" + item.B] = GetStr(item.B.ToString());//籃球  42 bulecleandr["X1"] = GetDa(item.B);// 43 bulecleandr["X2"] = GetXiao(item.B);// 44 bulecleandr["X3"] = GetJiShu(item.B);// 45 bulecleandr["X4"] = GetOShu(item.B);// 46 bulecleandr["X5"] = GetZhiShu(item.B);// 47 bulecleandr["X6"] = GetHeShu(item.B);// 48 bulecleandr["X7"] = GetFenQu1(item.B);//一區  49 bulecleandr["X8"] = GetFenQu2(item.B);//二區  50 bulecleandr["X9"] = GetFenQu3(item.B);//三區  51 bulecleandr["X10"] = GetFenQu4(item.B);//四區  52 bulecleandr["X11"] = GetWeiShu(item.B);//尾數  53 bulecleandr["X12"] = GetWeiShuQuJian(item.B, 0);//0-1  54 bulecleandr["X13"] = GetWeiShuQuJian(item.B, 2);//2-3  55 bulecleandr["X14"] = GetWeiShuQuJian(item.B, 4);//4-5  56 bulecleandr["X15"] = GetWeiShuQuJian(item.B, 6);//6-7  57 bulecleandr["X16"] = GetWeiShuQuJian(item.B, 8);//8-9  58  bulecleantable.Rows.Add(bulecleandr);  59  }  60  61 for (int j = 1; j < 17; j++)  62  {  63 int xint = 0;  64 for (int i = 0; i < buletable.Rows.Count; i++)  65  {  66 if (string.IsNullOrEmpty(buletable.Rows[i]["B" + j].ToString()))  67  {  68 xint++;  69 buletable.Rows[i]["B" + j] = xint;  70  }  71 else  72  {  73 xint = 0;  74  }  75  }  76  }  77  78 for (int j = 1; j < 17; j++)  79  {  80 int xint = 0;  81 for (int i = 0; i < buletable.Rows.Count; i++)  82  {  83 if (string.IsNullOrEmpty(buletable.Rows[i]["X"+j].ToString()))  84  {  85 xint++;  86 buletable.Rows[i]["X" + j] = xint;  87  }  88 else  89  {  90 xint = 0;  91  }  92  }  93  }  94  95 if (this.IsHandleCreated)  96  {  97 this.Invoke((MethodInvoker)delegate  98  {  99 if (flag) 100  { 101 bulecleantable.DefaultView.Sort = "QiHao DESC"; 102 this.gridControl5.DataSource = bulecleantable.DefaultView.ToTable(); 103  } 104 else 105  { 106 buletable.DefaultView.Sort = "QiHao DESC"; 107 this.gridControl5.DataSource = buletable.DefaultView.ToTable(); 108  } 109  }); 110  } 111  } 112  } 113 114 /// <summary> 115 /// 大數 116 /// </summary> 117 /// <param name="BuleCode"></param> 118 /// <returns></returns> 119 private string GetDa(int BuleCode) 120  { 121 if (BuleCode > 8) 122  { 123 return ""; 124  } 125 else 126  { 127 return ""; 128  } 129  } 130 131 /// <summary> 132 /// 小數 133 /// </summary> 134 /// <param name="BuleCode"></param> 135 /// <returns></returns> 136 private string GetXiao(int BuleCode) 137  { 138 if (BuleCode < 9) 139  { 140 return ""; 141  } 142 else 143  { 144 return ""; 145  } 146  } 147 148 /// <summary> 149 /// 奇數 150 /// </summary> 151 /// <param name="BuleCode"></param> 152 /// <returns></returns> 153 private string GetJiShu(int BuleCode) 154  { 155 if (BuleCode % 2 != 0) 156  { 157 return ""; 158  } 159 else 160  { 161 return ""; 162  } 163  } 164 165 /// <summary> 166 /// 偶數 167 /// </summary> 168 /// <param name="BuleCode"></param> 169 /// <returns></returns> 170 private string GetOShu(int BuleCode) 171  { 172 if (BuleCode % 2 == 0) 173  { 174 return ""; 175  } 176 else 177  { 178 return ""; 179  } 180  } 181 182 /// <summary> 183 /// 質數 184 /// </summary> 185 /// <param name="BuleCode"></param> 186 /// <returns></returns> 187 private string GetZhiShu(int BuleCode) 188  { 189 if (BuleCode == 1 || BuleCode == 2 || BuleCode == 3 || BuleCode == 5 || BuleCode == 7 || BuleCode == 11 || BuleCode == 13) 190  { 191 return ""; 192  } 193 else 194  { 195 return ""; 196  } 197  } 198 199 /// <summary> 200 /// 合數 201 /// </summary> 202 /// <param name="BuleCode"></param> 203 /// <returns></returns> 204 private string GetHeShu(int BuleCode) 205  { 206 if (BuleCode == 4 || BuleCode == 6 || BuleCode == 8 || BuleCode == 9 || BuleCode == 10 || BuleCode == 12 || BuleCode == 14 || BuleCode == 15 || BuleCode == 16) 207  { 208 return ""; 209  } 210 else 211  { 212 return ""; 213  } 214  } 215 216 /// <summary> 217 /// 分區1 218 /// </summary> 219 /// <param name="BuleCode"></param> 220 /// <returns></returns> 221 private string GetFenQu1(int BuleCode) 222  { 223 if (BuleCode < 5) 224  { 225 return "X"+BuleCode.ToString(); 226  } 227 else 228  { 229 return ""; 230  } 231  } 232 233 /// <summary> 234 /// 分區2 235 /// </summary> 236 /// <param name="BuleCode"></param> 237 /// <returns></returns> 238 private string GetFenQu2(int BuleCode) 239  { 240 if (BuleCode > 4 && BuleCode < 9) 241  { 242 return "X"+BuleCode.ToString(); 243  } 244 else 245  { 246 return ""; 247  } 248  } 249 250 /// <summary> 251 /// 分區3 252 /// </summary> 253 /// <param name="BuleCode"></param> 254 /// <returns></returns> 255 private string GetFenQu3(int BuleCode) 256  { 257 if (BuleCode > 8 && BuleCode < 13) 258  { 259 return "X"+BuleCode.ToString(); 260  } 261 else 262  { 263 return ""; 264  } 265  } 266 267 /// <summary> 268 /// 分區4 269 /// </summary> 270 /// <param name="BuleCode"></param> 271 /// <returns></returns> 272 private string GetFenQu4(int BuleCode) 273  { 274 if (BuleCode > 12) 275  { 276 return "X"+BuleCode.ToString(); 277  } 278 else 279  { 280 return ""; 281  } 282  } 283 284 /// <summary> 285 /// 尾數 286 /// </summary> 287 /// <param name="BuleCode"></param> 288 /// <returns></returns> 289 private string GetWeiShu(int BuleCode) 290  { 291 if (BuleCode < 10) 292  { 293 return BuleCode.ToString(); 294  } 295 else 296  { 297 return BuleCode.ToString().Substring(1, 1); 298  } 299  } 300 301 private string GetWeiShuQuJian(int BuleCode, int xint) 302  { 303 string weishu = GetWeiShu(BuleCode); 304 if (int.Parse(weishu) >= 0 + xint && int.Parse(weishu) <= 1 + xint) 305  { 306 return "Y" + weishu; 307  } 308 else 309  { 310 return ""; 311  } 312  } 313 #endregion
View Code

籃球走勢圖是最複雜的,也是本人花費最多時間的,望園友多關注。

 

8.歷史同期

歷史同期走勢圖效果圖:

歷史數據所有是用網上抓取的,在這裏就很少介紹了。

以上基本上把本人這段時間研究的這點東西所有公佈了,僅供各位參考和交流,若有興趣可加QQ羣(186841119)一塊兒交流學習C#的心得,我的的源碼會在這個羣空間裏上傳,提升技術水平,爲未來加薪打下良好的基礎,祝願各位都有一個好運氣,500W的大獎會降臨在你頭上。

相關文章
相關標籤/搜索