首页 > 代码库 > 用C#开发的双色球走势图(原创)值得园友拥有(二)接上一篇

用C#开发的双色球走势图(原创)值得园友拥有(二)接上一篇

        昨晚由于时间的原因只写了一部分内容,今天将这一部分内容补充完毕,多谢各位园友的支持。

        这是用C#开发的双色球走势图(原创)值得园友拥有 新的园友可以看昨晚写的内容,以免脱节。首先回复园友的评论,有说好的有说不好的,本人不管你说好还是不好,根本不影响个人写这篇博客,写这篇博客主要目的还是与大家交流技术,仅供交流和学习,本人花在这上面的时间的大楷也就是一个星期的晚上时间(星期一到星期五晚上)和周末(周六周日)的时间而已,并没有花费更多的时间;关于公布源码的问题,本人会在稍后公布,由于现在我的源码集成在我的一个项目里,所以不方便公布,一旦我把这个模块分离出来,会公布源码以供大家交流和学习,希各位继续支持和关注。还有就是这个程序纯粹个人好玩,不能预测开奖号码,不过这些分析数据可以供大家购买彩票之前的参考,我觉得还可以。

        以上为题外话,现在言归正传,继续介绍红球四分区走势图。

3.红球四分区走势图

首先呈上效果图:

 

不带遗漏数据的走势图:

贴上四分区走势图的源码:

  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.红球七分区走势图

 七分区走势图效果图:

不带遗漏数据的走势图:

贴上七分区走势图的源码:

  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 retlist134                                   where ("," + c + ",").Contains("," + retstr + ",")135                                   select c;136                         if (tmp.Count() == 0)137                         {138                             retlist.Add(retstr);139                         }140                     }141                     else142                     {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                         else100                         {101                             xint = 0;102                         }103                     }104                 }105 106                 if (this.IsHandleCreated)107                 {108                     this.Invoke((MethodInvoker)delegate109                     {110                         if (flag)111                         {112                             hezhicleantable.DefaultView.Sort = "QiHao DESC";113                             this.gridControl7.DataSource = hezhicleantable.DefaultView.ToTable();114                         }115                         else116                         {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                         else105                         {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             else126             {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             else143             {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             else160             {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             else177             {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             else194             {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             else211             {212                 return "";213             }214         }215 216         /// <summary>217         /// 分区1218         /// </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             else228             {229                 return "";230             }231         }232 233         /// <summary>234         /// 分区2235         /// </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             else245             {246                 return "";247             }248         }249 250         /// <summary>251         /// 分区3252         /// </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             else262             {263                 return "";264             }265         }266 267         /// <summary>268         /// 分区4269         /// </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             else279             {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             else296             {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             else309             {310                 return "";311             }312         }313         #endregion
View Code

篮球走势图是最复杂的,也是本人花费最多时间的,望园友多关注。

 

8.历史同期

历史同期走势图效果图:

历史数据全部是用网上抓取的,在这里就不多介绍了。

以上基本上把本人这段时间研究的这点东西全部公布了,仅供各位参考和交流,如有兴趣可加QQ群(186841119)一起交流学习C#的心得,个人的源码会在这个群空间里上传,提高技术水平,为将来加薪打下良好的基础,祝愿各位都有一个好运气,500W的大奖会降临在你头上。

用C#开发的双色球走势图(原创)值得园友拥有(二)接上一篇