12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using CB.Common;
- using System.Collections;
- namespace CB.Web.tool_old
- {
- public partial class p3ss_post : System.Web.UI.Page
- {
- //选择的数字
- private string bwString;
- private string swString;
- private string gwString;
- private string[] bwArray;
- private string[] swArray;
- private string[] gwArray;
- //杀号的数字
- private string pbwString;
- private string pswString;
- private string pgwString;
- private int pbh; //杀号的方式[排除选中的|包含选中的]
- //胆码过滤
- private string dbwString;
- private string dswString;
- private string dgwString;
- //二码和
- private string str_emh;
- private int emhh;
- //二码差
- private string str_emc;
- private int emch;
- //012路
- private string str_012;
- private int lubh;
- //二码过滤
- private string twoString;
- private int emhb;
- //和值
- private string hzString;
- private int hzhb;
- //和尾
- private string hwString;
- private int hwhb;
- //跨度
- private string kdString;
- private int kdhb;
- //大中小
- private string dzxString;
- private int dzxhb;
- //大小
- private string dxString;
- private int dxhb;
- //奇偶
- private string joString;
- private int johb;
- //质合
- private string zhString;
- private int zhhb;
- //顺子
- private int szbl;
- private int zuhe3;
- private int zuhe6;
- private int zuheb;
- private int zuhe;
- //大底
- private string dadihao;
- private int dzhixuan; //大底的直选或组选
- private ArrayList Number = new ArrayList();
- public System.Text.StringBuilder NumberString = new System.Text.StringBuilder();
- public System.Text.StringBuilder numValue = new System.Text.StringBuilder();
- public int zhushu;
- public string type;
- public string message;
- public bool flag = true;
- private int action;
- public string filename = "排列三(P3)过滤缩水结果号码";
- protected void Page_Load(object sender, EventArgs e)
- {
- action = WRequest.GetQueryInt("action", 0);
- GetValue();
- if (string.IsNullOrEmpty(bwString) && string.IsNullOrEmpty(swString) && string.IsNullOrEmpty(gwString) && string.IsNullOrEmpty(dadihao))
- {
- message = "没有选择条件一中定位 或 大底框中无内容";
- flag = false;
- return;
- }
- else
- {
- Number = numberArray(); //生成基本组合
- }
- //号码过滤
- numberFilter(pbwString, 0, pbh);
- numberFilter(pswString, 1, pbh);
- numberFilter(pgwString, 2, pbh);
- //胆码过滤
- dmFilter(dbwString, dswString, dgwString);
- //二码和过滤
- emhFilter(str_emh, emhh);
- //二码差过滤
- emcFilter(str_emc, emch);
- //二码过滤
- twoFilter(twoString, emhb);
- //012路过滤
- Filter_012(str_012, lubh);
- //和值过滤
- hzFilter(hzString, hzhb);
- //和尾
- hwFilter(hwString, hwhb);
- //跨度
- kdFilter(kdString, kdhb);
- dzxFilter(dzxString, dzxhb);
- //大小过滤
- dxFilter(dxString, dxhb);
- //奇偶过滤
- joFilter(joString, johb);
- //质合过滤
- zhFilter(zhString, zhhb);
- //顺子过滤
- if (szbl != 0)
- {
- FilterSz();
- }
- //组三组六豹子过滤
- //豹子过滤
- if (zuheb == 0)
- Number = ToolsUtils.zuhebFilter(Number, zuheb);
- //组三过滤
- if (zuhe3 == 0)
- Number = ToolsUtils.zuhe3Filter(Number, zuhe3);
- //组六过滤
- if (zuhe6 == 0)
- Number = ToolsUtils.zuhe6Filter(Number, zuhe6);
- //生成组选结果
- if (zuhe == 1)
- {
- Number = ToolsUtils.zuheFilter(Number);
- type = "组选";
- }
- else
- {
- type = "直选";
- }
- chArray(); //过滤重号
- //输出
- for (int i = 0; i < Number.Count; i++)
- {
- NumberString.Append(Number[i].ToString() + " ");
- numValue.Append(Number[i].ToString() + " ");
- }
- //生成组选结果
- if (zuhe == 1)
- {
- type = "组选";
- }
- else
- {
- type = "直选";
- }
- zhushu = Number.Count;
- }
- #region 去除重号
- private void chArray()
- {
- ArrayList al = new ArrayList();
- for (int i = 0; i < Number.Count; i++)
- {
- if (!al.Contains(Number[i]))
- al.Add(Number[i]);
- }
- Number.Clear();
- Number = al;
- }
- #endregion
- #region 顺子过滤
- /// <summary>
- /// 顺子过滤 2011-1-18 添加
- /// </summary>
- private void FilterSz()
- {
- ArrayList Tmp = new ArrayList();
- ArrayList temp = new ArrayList();
- int tp1 = 0;
- int tp2 = 0;
- for (int i = 0; i < Number.Count; i++)
- {
- temp.Clear();
- char[] tpchar = Number[i].ToString().ToCharArray();
- temp.Add(tpchar[0].ToString());
- temp.Add(tpchar[1].ToString());
- temp.Add(tpchar[2].ToString());
- temp.Sort();
- tp1 = Math.Abs(Convert.ToInt32(temp[0]) - Convert.ToInt32(temp[1]));
- tp2 = Math.Abs(Convert.ToInt32(temp[1]) - Convert.ToInt32(temp[2]));
- if (szbl == 1)
- {
- if (!(tp1 == 1 && tp2 == 1))
- {
- Tmp.Add(Number[i]);
- }
- }
- else
- {
- if (!(tp1 == 1 || tp2 == 1))
- {
- Tmp.Add(Number[i]);
- }
- }
- }
- if (Tmp.Count > 0)
- {
- Number.Clear();
- Number = Tmp;
- }
- }
- #endregion
- #region 质合
- private void zhFilter(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- string dx = string.Empty;
- ArrayList numArray = new ArrayList();
- for (int i = 0; i < Number.Count; i++)
- {
- numArray.Clear();
- for (int a = 0; a < Number[i].ToString().Length; a++)
- {
- numArray.Add(Number[i].ToString().Substring(a, 1));
- }
- if (Convert.ToInt32(numArray[0]) == 1 || Convert.ToInt32(numArray[0]) == 2 || Convert.ToInt32(numArray[0]) == 3 || Convert.ToInt32(numArray[0]) == 5 || Convert.ToInt32(numArray[0]) == 7)
- { dx = "质"; }
- else
- { dx = "合"; }
- if (Convert.ToInt32(numArray[1]) == 1 || Convert.ToInt32(numArray[1]) == 2 || Convert.ToInt32(numArray[1]) == 3 || Convert.ToInt32(numArray[1]) == 5 || Convert.ToInt32(numArray[1]) == 7)
- { dx = dx + "质"; }
- else
- { dx = dx + "合"; }
- if (Convert.ToInt32(numArray[2]) == 1 || Convert.ToInt32(numArray[2]) == 2 || Convert.ToInt32(numArray[2]) == 3 || Convert.ToInt32(numArray[2]) == 5 || Convert.ToInt32(numArray[2]) == 7)
- { dx = dx + "质"; }
- else
- { dx = dx + "合"; }
- if (iskill == 0)
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(dx) >= 0)
- {
- }
- else
- {
- tempNumber.Add(Number[i]);
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(dx) >= 0)
- {
- tempNumber.Add(Number[i]);
- }
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 奇偶过滤
- private void joFilter(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- string dx = string.Empty;
- ArrayList numArray = new ArrayList();
- for (int i = 0; i < Number.Count; i++)
- {
- numArray.Clear();
- for (int a = 0; a < Number[i].ToString().Length; a++)
- {
- numArray.Add(Number[i].ToString().Substring(a, 1));
- }
- if (Convert.ToInt32(numArray[0]) % 2 != 0)
- { dx = "奇"; }
- else
- { dx = "偶"; }
- if (Convert.ToInt32(numArray[1]) % 2 != 0)
- { dx = dx + "奇"; }
- else
- { dx = dx + "偶"; }
- if (Convert.ToInt32(numArray[2]) % 2 != 0)
- { dx = dx + "奇"; }
- else
- { dx = dx + "偶"; }
- if (iskill == 0)
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(dx) >= 0)
- {
- }
- else
- {
- tempNumber.Add(Number[i]);
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(dx) >= 0)
- {
- tempNumber.Add(Number[i]);
- }
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 大小过滤
- private void dxFilter(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- string dx = string.Empty;
- ArrayList numArray = new ArrayList();
- for (int i = 0; i < Number.Count; i++)
- {
- numArray.Clear();
- for (int a = 0; a < Number[i].ToString().Length; a++)
- {
- numArray.Add(Number[i].ToString().Substring(a, 1));
- }
- if (Convert.ToInt32(numArray[0]) < 5)
- { dx = "小"; }
- else
- { dx = "大"; }
- if (Convert.ToInt32(numArray[1]) < 5)
- { dx = dx + "小"; }
- else
- { dx = dx + "大"; }
- if (Convert.ToInt32(numArray[2]) < 5)
- { dx = dx + "小"; }
- else
- { dx = dx + "大"; }
- if (iskill == 0)
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(dx) >= 0)
- {
- }
- else
- {
- tempNumber.Add(Number[i]);
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(dx) >= 0)
- {
- tempNumber.Add(Number[i]);
- }
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 大中小过滤
- private void dzxFilter(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (str == null || str.Trim().Length == 0)
- {
- return;
- }
- else
- {
- string dzx = string.Empty;
- ArrayList numArray = new ArrayList();
- for (int i = 0; i < Number.Count; i++)
- {
- numArray.Clear();
- for (int a = 0; a < Number[i].ToString().Length; a++)
- {
- numArray.Add(Number[i].ToString().Substring(a, 1));
- }
- if (Convert.ToInt32(numArray[0]) < 3)
- { dzx = "小"; }
- else if (Convert.ToInt32(numArray[0]) < 7)
- {
- dzx = "中";
- }
- else
- { dzx = "大"; }
- if (Convert.ToInt32(numArray[1]) < 3)
- { dzx = dzx + "小"; }
- else if (Convert.ToInt32(numArray[1]) < 7)
- {
- dzx = dzx + "中";
- }
- else
- { dzx = dzx + "大"; }
- if (Convert.ToInt32(numArray[2]) < 3)
- { dzx = dzx + "小"; }
- else if (Convert.ToInt32(numArray[2]) < 7)
- {
- dzx = dzx + "中";
- }
- else
- { dzx = dzx + "大"; }
- if (iskill == 0)
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(dzx) >= 0)
- {
- }
- else
- {
- tempNumber.Add(Number[i]);
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(dzx) >= 0)
- {
- tempNumber.Add(Number[i]);
- }
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 跨度过滤
- private void kdFilter(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- int kd = 0;
- ArrayList kdArray = new ArrayList();
- for (int i = 0; i < Number.Count; i++)
- {
- kd = 0;
- kdArray.Clear();
- for (int a = 0; a < Number[i].ToString().Length; a++)
- {
- kdArray.Add(Number[i].ToString().Substring(a, 1));
- }
- kdArray.Sort();
- kd = System.Math.Abs(Convert.ToInt32(kdArray[2]) - Convert.ToInt32(kdArray[0]));
- if (iskill == 0)
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(kd.ToString()) != -1)
- {
- }
- else
- {
- tempNumber.Add(Number[i]);
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(kd.ToString()) != -1)
- {
- tempNumber.Add(Number[i]);
- }
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 和尾
- private void hwFilter(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- int hw = 0;
- for (int i = 0; i < Number.Count; i++)
- {
- hw = 0;
- for (int a = 0; a < Number[i].ToString().Length; a++)
- {
- hw = hw + Convert.ToInt32(Number[i].ToString().Substring(a, 1));
- }
- hw = Convert.ToInt32(hw.ToString("00").Substring(1, 1));
- if (iskill == 0)
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(hw.ToString()) != -1)
- {
- }
- else
- {
- tempNumber.Add(Number[i]);
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(hw.ToString()) != -1)
- {
- tempNumber.Add(Number[i]);
- }
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 和值
- private void hzFilter(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- ArrayList hzArray = null;
- if (!string.IsNullOrEmpty(str))
- { hzArray = new ArrayList(str.Trim().Split(',')); }
- else
- {
- return;
- }
- int hz = 0;
- for (int i = 0; i < Number.Count; i++)
- {
- hz = Convert.ToInt32(Number[i].ToString().Substring(0, 1)) + Convert.ToInt32(Number[i].ToString().Substring(1, 1)) + Convert.ToInt32(Number[i].ToString().Substring(2, 1));
- if (iskill == 0)
- {
- if (!hzArray.Contains(hz.ToString()))
- {
- tempNumber.Add(Number[i]);
- }
- }
- else
- {
- if (hzArray.Contains(hz.ToString()))
- {
- tempNumber.Add(Number[i]);
- }
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 二码和过滤
- private void emhFilter(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- ArrayList filterList = new ArrayList();
- ArrayList emh = new ArrayList();
- string[] tmpFilter = str.Split(',');
- for (int i = 0; i < tmpFilter.Length; i++)
- filterList.Add(Convert.ToInt32(tmpFilter[i]));
- int add;
- for (int i = 0; i < Number.Count; i++)
- {
- add = 0;
- emh = GetEmHC(Number[i].ToString(), 0);
- for (int j = 0; j < emh.Count; j++)
- {
- if (iskill == 0) //排除选中
- {
- if (filterList.Contains(emh[j]))
- {
- add = 0;
- break;
- }
- else
- {
- add = 1;
- }
- }
- else //包含选中
- {
- if (filterList.Contains(emh[j]))
- {
- add = 1;
- break;
- }
- }
- }
- if (add == 1) tempNumber.Add(Number[i]);
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 二码差过滤
- private void emcFilter(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- ArrayList emc = new ArrayList();
- int add;
- for (int i = 0; i < Number.Count; i++)
- {
- add = 0;
- emc = GetEmHC(Number[i].ToString(), 1);
- for (int j = 0; j < emc.Count; j++)
- {
- if (iskill == 0) //排除选中
- {
- if (str.IndexOf(emc[j].ToString()) != -1)
- {
- add = 0;
- break;
- }
- else
- {
- add = 1;
- }
- }
- else //包含选中
- {
- if (str.IndexOf(emc[j].ToString()) != -1)
- {
- add = 1;
- break;
- }
- }
- }
- if (add == 1) tempNumber.Add(Number[i]);
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 二码过滤
- private void twoFilter(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- string t1 = string.Empty;
- string t2 = string.Empty;
- string t3 = string.Empty;
- string t4 = string.Empty;
- string t5 = string.Empty;
- string t6 = string.Empty;
- for (int i = 0; i < Number.Count; i++)
- {
- t1 = Number[i].ToString().Substring(0, 1) + Number[i].ToString().Substring(1, 1);
- t4 = Number[i].ToString().Substring(1, 1) + Number[i].ToString().Substring(0, 1);
- t2 = Number[i].ToString().Substring(1, 1) + Number[i].ToString().Substring(2, 1);
- t5 = Number[i].ToString().Substring(2, 1) + Number[i].ToString().Substring(1, 1);
- t3 = Number[i].ToString().Substring(0, 1) + Number[i].ToString().Substring(2, 1);
- t6 = Number[i].ToString().Substring(2, 1) + Number[i].ToString().Substring(0, 1);
- if (iskill == 0)
- {
- if (!string.IsNullOrEmpty(str) && (str.Trim().IndexOf(t1) >= 0 || str.Trim().IndexOf(t2) >= 0 || str.Trim().IndexOf(t3) >= 0 || str.Trim().IndexOf(t4) >= 0 || str.Trim().IndexOf(t5) >= 0 || str.Trim().IndexOf(t6) >= 0))
- { }
- else
- {
- tempNumber.Add(Number[i]);
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(str) && (str.Trim().IndexOf(t1) >= 0 || str.Trim().IndexOf(t2) >= 0 || str.Trim().IndexOf(t3) >= 0 || str.Trim().IndexOf(t4) >= 0 || str.Trim().IndexOf(t5) >= 0 || str.Trim().IndexOf(t6) >= 0))
- {
- tempNumber.Add(Number[i]);
- }
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 012路过滤
- private void Filter_012(string str, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- string state = string.Empty;
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- for (int i = 0; i < Number.Count; i++)
- {
- state = Convert.ToString(Convert.ToInt32(Number[i].ToString().Substring(0, 1)) % 3) + Convert.ToString(Convert.ToInt32(Number[i].ToString().Substring(1, 1)) % 3) + Convert.ToString(Convert.ToInt32(Number[i].ToString().Substring(2, 1)) % 3);
- if (iskill == 0)
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(state) >= 0)
- {
- }
- else
- {
- tempNumber.Add(Number[i]);
- }
- }
- else
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(state) >= 0)
- tempNumber.Add(Number[i]);
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 胆码过滤
- private void dmFilter(string str, string str1, string str2)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str) && string.IsNullOrEmpty(str1) && string.IsNullOrEmpty(str2))
- {
- return;
- }
- else
- {
- for (int i = 0; i < Number.Count; i++)
- {
- if ((!string.IsNullOrEmpty(str) && str.Trim().IndexOf(Number[i].ToString().Substring(0, 1)) != -1) || (!string.IsNullOrEmpty(str1) && str1.Trim().IndexOf(Number[i].ToString().Substring(1, 1)) != -1) || (!string.IsNullOrEmpty(str2) && str2.Trim().IndexOf(Number[i].ToString().Substring(2, 1)) != -1))
- {
- tempNumber.Add(Number[i]);
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 号码过滤
- /// <summary>
- /// 百十个号码过滤
- /// </summary>
- private void numberFilter(string str, int a, int iskill)
- {
- ArrayList tempNumber = new ArrayList();
- if (string.IsNullOrEmpty(str))
- {
- return;
- }
- else
- {
- for (int i = 0; i < Number.Count; i++)
- {
- if (iskill == 0)
- {
- if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(Number[i].ToString().Substring(a, 1)) >= 0)
- { }
- else
- {
- tempNumber.Add(Number[i]);
- }
- }
- }
- }
- Number.Clear();
- Number = tempNumber;
- }
- #endregion
- #region 生成号码组合
- /// <summary>
- /// 生成选择的数据组合
- /// </summary>
- /// <returns>ArrayList</returns>
- private ArrayList numberArray()
- {
- ArrayList Number = new ArrayList();
- string strs = string.Empty;
- if (!string.IsNullOrEmpty(bwString) && !string.IsNullOrEmpty(swString) && !string.IsNullOrEmpty(gwString))
- {
- strs = bwString + swString + gwString;
- }
- if (strs.Length > 0) //根据选号生成号码
- {
- bwArray = bwString.Split(',');
- swArray = swString.Split(',');
- gwArray = gwString.Split(',');
- for (int a = 0; a < bwArray.Length; a++)
- {
- for (int b = 0; b < swArray.Length; b++)
- {
- for (int c = 0; c < gwArray.Length; c++)
- {
- Number.Add(bwArray[a] + swArray[b] + gwArray[c]);
- }
- }
- }
- }
- else if (!string.IsNullOrEmpty(dadihao)) //根据
- {
- dadihao = dadihao.Replace("\r\n", ",");
- dadihao = dadihao.Replace(" ", ",");
- dadihao = dadihao.Replace(" ", ",");
- string[] Numbers = dadihao.Split(',');
- for (int i = 0; i < Numbers.Length; i++) //去除位数不对的数据和重复的数据
- {
- if (Numbers[i].Trim().Length == 3 && !Number.Contains(Numbers[i]))
- Number.Add(Numbers[i]);
- }
- if (dzhixuan == 1) //用户选择了组选
- {
- ArrayList al = new ArrayList();
- string t1 = string.Empty;
- string t2 = string.Empty;
- string t3 = string.Empty;
- string t = string.Empty;
- for (int i = 0; i < Number.Count; i++)
- {
- t1 = Number[i].ToString().Substring(0, 1);
- t2 = Number[i].ToString().Substring(1, 1);
- t3 = Number[i].ToString().Substring(2, 1);
- al.Add(t1 + t2 + t3);
- al.Add(t1 + t3 + t2);
- al.Add(t2 + t1 + t3);
- al.Add(t2 + t3 + t1);
- al.Add(t3 + t1 + t2);
- al.Add(t3 + t2 + t1);
- }
- Number.Clear();
- Number = al;
- }
- }
- return Number;
- }
- #endregion
- #region 获取二码和差
- private static ArrayList GetEmHC(string str, int tp) //tp 0为和,1为差
- {
- int a, b, c;
- int hc1, hc2, hc3;
- ArrayList arr = new ArrayList();
- a = Convert.ToInt32(str.Substring(0, 1));
- b = Convert.ToInt32(str.Substring(1, 1));
- c = Convert.ToInt32(str.Substring(2, 1));
- if (tp == 0)
- {
- hc1 = a + b;
- hc2 = a + c;
- hc3 = b + c;
- }
- else
- {
- hc1 = Math.Abs(a - b);
- hc2 = Math.Abs(a - c);
- hc3 = Math.Abs(b - c);
- }
- arr.Add(hc1);
- if (!arr.Contains(hc2)) arr.Add(hc2);
- if (!arr.Contains(hc3)) arr.Add(hc3);
- return arr;
- }
- #endregion
- #region 取值
- private void GetValue()
- {
- //选号
- bwString = WRequest.GetFormString("bw");
- swString = WRequest.GetFormString("sw");
- gwString = WRequest.GetFormString("gw");
- //大底
- dzhixuan = WRequest.GetFormInt("dzx", 0);
- dadihao = WRequest.GetFormString("dadihao");
- //号码过滤
- pbh = WRequest.GetFormInt("pbh", 0);
- pbwString = WRequest.GetFormString("pbw");
- pswString = WRequest.GetFormString("psw");
- pgwString = WRequest.GetFormString("pgw");
- //胆码过滤
- dbwString = WRequest.GetFormString("dbw");
- dswString = WRequest.GetFormString("dsw");
- dgwString = WRequest.GetFormString("dgw");
- //012路
- str_012 = WRequest.GetFormString("lubl");
- lubh = WRequest.GetFormInt("lubh", 0);
- //二码过滤
- twoString = WRequest.GetFormString("embl").Trim();
- emhb = WRequest.GetFormInt("emhb", 0);
- //二码和过滤
- str_emh = WRequest.GetFormString("pemh").Trim();
- emhh = WRequest.GetFormInt("pemhr", 0);
- //二码差
- str_emc = WRequest.GetFormString("pemc").Trim();
- emch = WRequest.GetFormInt("pemcr", 0);
- //和值
- hzString = WRequest.GetFormString("hzbl").Trim();
- hzhb = WRequest.GetFormInt("hzhb", 0);
- // 和尾
- hwString = WRequest.GetFormString("hwbl").Trim(); ;
- hwhb = WRequest.GetFormInt("hwhb", 0);
- // 跨度
- kdString = WRequest.GetFormString("kdbl").Trim();
- kdhb = WRequest.GetFormInt("kdhb", 0);
- //大中小
- dzxString = WRequest.GetFormString("dzxbl").Trim();
- dzxhb = WRequest.GetFormInt("dzxhb", 0);
- //大小
- dxString = WRequest.GetFormString("dxbl").Trim();
- dxhb = WRequest.GetFormInt("dxhb", 0);
- //奇偶
- joString = WRequest.GetFormString("jobl").Trim();
- johb = WRequest.GetFormInt("johb", 0);
- //质合
- zhString = WRequest.GetFormString("zhbl").Trim();
- zhhb = WRequest.GetFormInt("zhhb", 0);
- //顺子
- szbl = WRequest.GetFormInt("szbl", 0);
- //组合
- zuhe3 = WRequest.GetFormInt("zuhe3", 0);
- zuhe6 = WRequest.GetFormInt("zuhe6", 0);
- zuheb = WRequest.GetFormInt("zuheb", 0);
- //直选.组选
- zuhe = WRequest.GetFormInt("zuhe", 0);
- }
- #endregion
- }
- }
|