3dss_zx_post.aspx.cs 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Web;
  4. using System.Web.UI;
  5. using System.Web.UI.WebControls;
  6. using System.Collections;
  7. using System.Text;
  8. using CB.Common;
  9. namespace CB.Web.tool_old
  10. {
  11. public partial class _3dss_zx_post : System.Web.UI.Page
  12. {
  13. //选择的数字
  14. private string bwString;
  15. private string[] bwArray;
  16. //杀号的数字
  17. private string pbwString;
  18. private int pbh; //杀号的方式[排除选中的|包含选中的]
  19. //胆码过滤
  20. private string dbwString;
  21. //二码和
  22. private string str_emh;
  23. private int emhh;
  24. //二码差
  25. private string str_emc;
  26. private int emch;
  27. //012路
  28. private string str_012;
  29. private int lubh;
  30. //二码过滤
  31. private string twoString;
  32. private int emhb;
  33. //和值
  34. private string hzString;
  35. private int hzhb;
  36. //和尾
  37. private string hwString;
  38. private int hwhb;
  39. //跨度
  40. private string kdString;
  41. private int kdhb;
  42. //大小
  43. private string dxString;
  44. private int dxhb;
  45. //奇偶
  46. private string joString;
  47. private int johb;
  48. //质合
  49. private string zhString;
  50. private int zhhb;
  51. //顺子
  52. private int szbl;
  53. private int zuhe3;
  54. private int zuhe6;
  55. //大底
  56. private string dadihao;
  57. private int dzhixuan; //大底的直选或组选
  58. private ArrayList Number = new ArrayList();
  59. public System.Text.StringBuilder NumberString = new System.Text.StringBuilder();
  60. public System.Text.StringBuilder numValue = new System.Text.StringBuilder();
  61. public int zhushu;
  62. public string type;
  63. public string message;
  64. public bool flag = true;
  65. public string filename = "3D过滤缩水结果号码(组选版)";
  66. //记录用户过滤数据/条件相关
  67. private string sourcedata = "";
  68. private string condition = "";
  69. private string tpzx = "";
  70. protected void Page_Load(object sender, EventArgs e)
  71. {
  72. GetValue();
  73. if (string.IsNullOrEmpty(bwString) && string.IsNullOrEmpty(dadihao))
  74. {
  75. message = "没有选择条件一中号码 或 大底框中无内容";
  76. flag = false;
  77. return;
  78. }
  79. else
  80. {
  81. Number = numberArray(); //生成基本组合
  82. }
  83. //号码过滤
  84. numberFilter(pbwString, 0, pbh);
  85. numberFilter(pbwString, 1, pbh);
  86. numberFilter(pbwString, 2, pbh);
  87. //胆码过滤
  88. dmFilter(dbwString, dbwString, dbwString);
  89. //二码和过滤
  90. emhFilter(str_emh, emhh);
  91. //二码差过滤
  92. emcFilter(str_emc, emch);
  93. //二码过滤
  94. twoFilter(twoString, emhb);
  95. //012路过滤
  96. Filter_012(str_012, lubh);
  97. //和值过滤
  98. hzFilter(hzString, hzhb);
  99. //和尾
  100. hwFilter(hwString, hwhb);
  101. //跨度
  102. kdFilter(kdString, kdhb);
  103. //大小过滤
  104. dxFilter(dxString, dxhb);
  105. //奇偶过滤
  106. joFilter(joString, johb);
  107. //质合过滤
  108. zhFilter(zhString, zhhb);
  109. //顺子过滤
  110. if (szbl != 0)
  111. FilterSz();
  112. Number = ToolsUtils.zuhebFilter(Number, 0);
  113. //组三过滤
  114. if (zuhe3 == 0)
  115. {
  116. Number = ToolsUtils.zuhe3Filter(Number, zuhe3);
  117. tpzx += "组三,";
  118. }
  119. //组六过滤
  120. if (zuhe6 == 0)
  121. {
  122. Number = ToolsUtils.zuhe6Filter(Number, zuhe6);
  123. tpzx += "组六";
  124. }
  125. condition += "组选:" + tpzx;
  126. ///生成组选结果
  127. Number = ToolsUtils.zuheFilter(Number);
  128. chArray(); //过滤重号
  129. //输出
  130. for (int i = 0; i < Number.Count; i++)
  131. {
  132. NumberString.Append(Number[i].ToString() + " ");
  133. numValue.Append(Number[i].ToString() + " ");
  134. }
  135. zhushu = Number.Count;
  136. }
  137. #region 去除重号
  138. private void chArray()
  139. {
  140. ArrayList al = new ArrayList();
  141. for (int i = 0; i < Number.Count; i++)
  142. {
  143. if (!al.Contains(Number[i]))
  144. al.Add(Number[i]);
  145. }
  146. Number.Clear();
  147. Number = al;
  148. }
  149. #endregion
  150. #region 顺子过滤
  151. /// <summary>
  152. /// 顺子过滤 2011-1-18 添加
  153. /// </summary>
  154. private void FilterSz()
  155. {
  156. ArrayList Tmp = new ArrayList();
  157. ArrayList temp = new ArrayList();
  158. int tp1 = 0;
  159. int tp2 = 0;
  160. int tp3 = 0;
  161. for (int i = 0; i < Number.Count; i++)
  162. {
  163. temp.Clear();
  164. char[] tpchar = Number[i].ToString().ToCharArray();
  165. temp.Add(tpchar[0].ToString());
  166. temp.Add(tpchar[1].ToString());
  167. temp.Add(tpchar[2].ToString());
  168. temp.Sort();
  169. tp1 = Math.Abs(Convert.ToInt32(temp[0]) - Convert.ToInt32(temp[1]));
  170. tp2 = Math.Abs(Convert.ToInt32(temp[1]) - Convert.ToInt32(temp[2]));
  171. tp3 = Math.Abs(Convert.ToInt32(temp[2]) - Convert.ToInt32(temp[0]));
  172. if (szbl == 1)
  173. {
  174. if (!(tp1 == 1 && tp2 == 1))
  175. {
  176. Tmp.Add(Number[i]);
  177. }
  178. }
  179. else
  180. {
  181. if (!(tp1 == 1 || tp2 == 1 || tp3 == 1))
  182. {
  183. Tmp.Add(Number[i]);
  184. }
  185. }
  186. }
  187. if (Tmp.Count > 0)
  188. {
  189. Number.Clear();
  190. Number = Tmp;
  191. }
  192. condition += "顺子:" + szbl.ToString() + "@";
  193. }
  194. #endregion
  195. #region 质合
  196. private void zhFilter(string str, int iskill)
  197. {
  198. string _str = str.Trim();
  199. if (string.IsNullOrEmpty(_str))
  200. {
  201. return;
  202. }
  203. else
  204. {
  205. ArrayList tempNumber = new ArrayList();
  206. for (int i = 0; i < Number.Count; i++)
  207. {
  208. string tpstr = string.Empty;
  209. int tp = 0;
  210. int tpa = Convert.ToInt32(Number[i].ToString().Substring(0, 1));
  211. int tpb = Convert.ToInt32(Number[i].ToString().Substring(1, 1));
  212. int tpc = Convert.ToInt32(Number[i].ToString().Substring(2, 1));
  213. if (tpa == 1 || tpa == 2 || tpa == 3 || tpa == 5 || tpa == 7)
  214. { tp++; }
  215. if (tpb == 1 || tpb == 2 || tpb == 3 || tpb == 5 || tpb == 7)
  216. { tp++; }
  217. if (tpc == 1 || tpc == 2 || tpc == 3 || tpc == 5 || tpc == 7)
  218. { tp++; }
  219. if (tp == 0)
  220. { tpstr = "全合"; }
  221. if (tp == 1)
  222. { tpstr = "两合一质"; }
  223. if (tp == 2)
  224. { tpstr = "两质一合"; }
  225. if (tp == 3)
  226. { tpstr = "全质"; }
  227. if (iskill == 0)
  228. {
  229. if (_str.IndexOf(tpstr) == -1)
  230. { tempNumber.Add(Number[i]); }
  231. }
  232. else
  233. {
  234. if (_str.IndexOf(tpstr) != -1)
  235. { tempNumber.Add(Number[i]); }
  236. }
  237. }
  238. Number.Clear();
  239. Number = tempNumber;
  240. condition += "质合:" + iskill.ToString() + "#" + str + "@";
  241. }
  242. }
  243. #endregion
  244. #region 奇偶过滤
  245. private void joFilter(string str, int iskill)
  246. {
  247. string _str = str.Trim();
  248. if (string.IsNullOrEmpty(_str))
  249. {
  250. return;
  251. }
  252. else
  253. {
  254. ArrayList tempNumber = new ArrayList();
  255. for (int i = 0; i < Number.Count; i++)
  256. {
  257. int tp = 0;
  258. string tpstr = string.Empty;
  259. if (Convert.ToInt32(Number[i].ToString().Substring(0, 1)) % 2 == 0)
  260. { tp++; }
  261. if (Convert.ToInt32(Number[i].ToString().Substring(1, 1)) % 2 == 0)
  262. { tp++; }
  263. if (Convert.ToInt32(Number[i].ToString().Substring(2, 1)) % 2 == 0)
  264. { tp++; }
  265. if (tp == 0)
  266. { tpstr = "全奇"; }
  267. if (tp == 1)
  268. { tpstr = "两奇一偶"; }
  269. if (tp == 2)
  270. { tpstr = "两偶一奇"; }
  271. if (tp == 3)
  272. { tpstr = "全偶"; }
  273. if (iskill == 0)
  274. {
  275. if (_str.IndexOf(tpstr) == -1)
  276. { tempNumber.Add(Number[i]); }
  277. }
  278. else
  279. {
  280. if (_str.IndexOf(tpstr) != -1)
  281. { tempNumber.Add(Number[i]); }
  282. }
  283. }
  284. Number.Clear();
  285. Number = tempNumber;
  286. condition += "奇偶:" + iskill.ToString() + "#" + _str + "@";
  287. }
  288. }
  289. #endregion
  290. #region 大小过滤
  291. private void dxFilter(string str, int iskill)
  292. {
  293. string _str = str.Trim();
  294. if (string.IsNullOrEmpty(_str))
  295. {
  296. return;
  297. }
  298. else
  299. {
  300. ArrayList tempNumber = new ArrayList();
  301. for (int i = 0; i < Number.Count; i++)
  302. {
  303. int tp = 0;
  304. string tpstr = string.Empty;
  305. if (Convert.ToInt32(Number[i].ToString().Substring(0, 1)) >= 5)
  306. { tp++; }
  307. if (Convert.ToInt32(Number[i].ToString().Substring(1, 1)) >= 5)
  308. { tp++; }
  309. if (Convert.ToInt32(Number[i].ToString().Substring(2, 1)) >= 5)
  310. { tp++; }
  311. if (tp == 0)
  312. { tpstr = "全小"; }
  313. if (tp == 1)
  314. { tpstr = "两小一大"; }
  315. if (tp == 2)
  316. { tpstr = "两大一小"; }
  317. if (tp == 3)
  318. { tpstr = "全大"; }
  319. if (iskill == 0)
  320. {
  321. if (_str.IndexOf(tpstr) == -1)
  322. { tempNumber.Add(Number[i]); }
  323. }
  324. else
  325. {
  326. if (_str.IndexOf(tpstr) != -1)
  327. { tempNumber.Add(Number[i]); }
  328. }
  329. }
  330. Number.Clear();
  331. Number = tempNumber;
  332. condition += "大小:" + iskill.ToString() + "#" + _str + "@";
  333. }
  334. }
  335. #endregion
  336. #region 跨度过滤
  337. private void kdFilter(string str, int iskill)
  338. {
  339. ArrayList tempNumber = new ArrayList();
  340. if (string.IsNullOrEmpty(str))
  341. {
  342. return;
  343. }
  344. else
  345. {
  346. int kd = 0;
  347. ArrayList kdArray = new ArrayList();
  348. for (int i = 0; i < Number.Count; i++)
  349. {
  350. kd = 0;
  351. kdArray.Clear();
  352. for (int a = 0; a < Number[i].ToString().Length; a++)
  353. {
  354. kdArray.Add(Number[i].ToString().Substring(a, 1));
  355. }
  356. kdArray.Sort();
  357. kd = System.Math.Abs(Convert.ToInt32(kdArray[2]) - Convert.ToInt32(kdArray[0]));
  358. if (iskill == 0)
  359. {
  360. if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(kd.ToString()) != -1)
  361. {
  362. }
  363. else
  364. {
  365. tempNumber.Add(Number[i]);
  366. }
  367. }
  368. else
  369. {
  370. if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(kd.ToString()) != -1)
  371. {
  372. tempNumber.Add(Number[i]);
  373. }
  374. }
  375. }
  376. condition += "跨度:" + iskill.ToString() + "#" + str + "@";
  377. }
  378. Number.Clear();
  379. Number = tempNumber;
  380. }
  381. #endregion
  382. #region 和尾
  383. private void hwFilter(string str, int iskill)
  384. {
  385. ArrayList tempNumber = new ArrayList();
  386. if (string.IsNullOrEmpty(str))
  387. {
  388. return;
  389. }
  390. else
  391. {
  392. int hw = 0;
  393. for (int i = 0; i < Number.Count; i++)
  394. {
  395. hw = 0;
  396. for (int a = 0; a < Number[i].ToString().Length; a++)
  397. {
  398. hw = hw + Convert.ToInt32(Number[i].ToString().Substring(a, 1));
  399. }
  400. hw = Convert.ToInt32(hw.ToString("00").Substring(1, 1));
  401. if (iskill == 0)
  402. {
  403. if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(hw.ToString()) != -1)
  404. {
  405. }
  406. else
  407. {
  408. tempNumber.Add(Number[i]);
  409. }
  410. }
  411. else
  412. {
  413. if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(hw.ToString()) != -1)
  414. {
  415. tempNumber.Add(Number[i]);
  416. }
  417. }
  418. }
  419. condition += "和尾:" + iskill.ToString() + "#" + str + "@";
  420. }
  421. Number.Clear();
  422. Number = tempNumber;
  423. }
  424. #endregion
  425. #region 和值
  426. private void hzFilter(string str, int iskill)
  427. {
  428. ArrayList tempNumber = new ArrayList();
  429. if (string.IsNullOrEmpty(str))
  430. {
  431. return;
  432. }
  433. else
  434. {
  435. ArrayList hzArray = null;
  436. if (!string.IsNullOrEmpty(str))
  437. { hzArray = new ArrayList(str.Trim().Split(',')); }
  438. else
  439. {
  440. return;
  441. }
  442. int hz = 0;
  443. for (int i = 0; i < Number.Count; i++)
  444. {
  445. 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));
  446. if (iskill == 0)
  447. {
  448. if (!hzArray.Contains(hz.ToString()))
  449. {
  450. tempNumber.Add(Number[i]);
  451. }
  452. }
  453. else
  454. {
  455. if (hzArray.Contains(hz.ToString()))
  456. {
  457. tempNumber.Add(Number[i]);
  458. }
  459. }
  460. }
  461. condition += "和值:" + iskill.ToString() + "#" + str + "@";
  462. }
  463. Number.Clear();
  464. Number = tempNumber;
  465. }
  466. #endregion
  467. #region 012路过滤
  468. private void Filter_012(string str, int iskill)
  469. {
  470. string _str = str.Trim();
  471. if (string.IsNullOrEmpty(_str))
  472. {
  473. return;
  474. }
  475. else
  476. {
  477. ArrayList tempNumber = new ArrayList();
  478. string tp012 = string.Empty;
  479. for (int i = 0; i < Number.Count; i++)
  480. {
  481. int[] tp = { 0, 0, 0 };
  482. tp[Convert.ToInt32(Number[i].ToString().Substring(0, 1)) % 3]++;
  483. tp[Convert.ToInt32(Number[i].ToString().Substring(1, 1)) % 3]++;
  484. tp[Convert.ToInt32(Number[i].ToString().Substring(2, 1)) % 3]++;
  485. if (tp[0] == 1 && tp[1] == 1 && tp[2] == 1)
  486. { tp012 = "各1个"; }
  487. if (tp[0] == 2)
  488. { tp012 = "2个0"; }
  489. if (tp[0] == 3)
  490. { tp012 = "3个0"; }
  491. if (tp[1] == 2)
  492. { tp012 = "2个1"; }
  493. if (tp[1] == 3)
  494. { tp012 = "3个1"; }
  495. if (tp[2] == 2)
  496. { tp012 = "2个2"; }
  497. if (tp[2] == 3)
  498. { tp012 = "3个2"; }
  499. if (iskill == 0)
  500. {
  501. if (_str.IndexOf(tp012) == -1)
  502. { tempNumber.Add(Number[i]); }
  503. }
  504. else
  505. {
  506. if (_str.IndexOf(tp012) != -1)
  507. { tempNumber.Add(Number[i]); }
  508. }
  509. }
  510. Number.Clear();
  511. Number = tempNumber;
  512. condition += "012路:" + iskill.ToString() + "#" + _str + "@";
  513. }
  514. }
  515. #endregion
  516. #region 二码差过滤
  517. private void emcFilter(string str, int iskill)
  518. {
  519. ArrayList tempNumber = new ArrayList();
  520. if (string.IsNullOrEmpty(str))
  521. {
  522. return;
  523. }
  524. else
  525. {
  526. ArrayList emc = new ArrayList();
  527. int add;
  528. for (int i = 0; i < Number.Count; i++)
  529. {
  530. add = 0;
  531. emc = GetEmHC(Number[i].ToString(), 1);
  532. for (int j = 0; j < emc.Count; j++)
  533. {
  534. if (iskill == 0) //排除选中
  535. {
  536. if (str.IndexOf(emc[j].ToString()) != -1)
  537. {
  538. add = 0;
  539. break;
  540. }
  541. else
  542. {
  543. add = 1;
  544. }
  545. }
  546. else //包含选中
  547. {
  548. if (str.IndexOf(emc[j].ToString()) != -1)
  549. {
  550. add = 1;
  551. break;
  552. }
  553. }
  554. }
  555. if (add == 1) tempNumber.Add(Number[i]);
  556. }
  557. condition += "二码差:" + iskill.ToString() + "#" + str + "@";
  558. }
  559. Number.Clear();
  560. Number = tempNumber;
  561. }
  562. #endregion
  563. #region 二码过滤
  564. private void twoFilter(string str, int iskill)
  565. {
  566. ArrayList tempNumber = new ArrayList();
  567. if (string.IsNullOrEmpty(str))
  568. {
  569. return;
  570. }
  571. else
  572. {
  573. string t1 = string.Empty;
  574. string t2 = string.Empty;
  575. string t3 = string.Empty;
  576. string t4 = string.Empty;
  577. string t5 = string.Empty;
  578. string t6 = string.Empty;
  579. for (int i = 0; i < Number.Count; i++)
  580. {
  581. t1 = Number[i].ToString().Substring(0, 1) + Number[i].ToString().Substring(1, 1);
  582. t4 = Number[i].ToString().Substring(1, 1) + Number[i].ToString().Substring(0, 1);
  583. t2 = Number[i].ToString().Substring(1, 1) + Number[i].ToString().Substring(2, 1);
  584. t5 = Number[i].ToString().Substring(2, 1) + Number[i].ToString().Substring(1, 1);
  585. t3 = Number[i].ToString().Substring(0, 1) + Number[i].ToString().Substring(2, 1);
  586. t6 = Number[i].ToString().Substring(2, 1) + Number[i].ToString().Substring(0, 1);
  587. if (iskill == 0)
  588. {
  589. 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))
  590. { }
  591. else
  592. {
  593. tempNumber.Add(Number[i]);
  594. }
  595. }
  596. else
  597. {
  598. 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))
  599. {
  600. tempNumber.Add(Number[i]);
  601. }
  602. }
  603. }
  604. condition += "二码:" + iskill.ToString() + "#" + str + "@";
  605. }
  606. Number.Clear();
  607. Number = tempNumber;
  608. }
  609. #endregion
  610. #region 二码和过滤
  611. private void emhFilter(string str, int iskill)
  612. {
  613. ArrayList tempNumber = new ArrayList();
  614. if (string.IsNullOrEmpty(str))
  615. {
  616. return;
  617. }
  618. else
  619. {
  620. ArrayList filterList = new ArrayList();
  621. ArrayList emh = new ArrayList();
  622. string[] tmpFilter = str.Split(',');
  623. for (int i = 0; i < tmpFilter.Length; i++)
  624. filterList.Add(Convert.ToInt32(tmpFilter[i]));
  625. int add;
  626. for (int i = 0; i < Number.Count; i++)
  627. {
  628. add = 0;
  629. emh = GetEmHC(Number[i].ToString(), 0);
  630. for (int j = 0; j < emh.Count; j++)
  631. {
  632. if (iskill == 0) //排除选中
  633. {
  634. if (filterList.Contains(emh[j]))
  635. {
  636. add = 0;
  637. break;
  638. }
  639. else
  640. {
  641. add = 1;
  642. }
  643. }
  644. else //包含选中
  645. {
  646. if (filterList.Contains(emh[j]))
  647. {
  648. add = 1;
  649. break;
  650. }
  651. }
  652. }
  653. if (add == 1) tempNumber.Add(Number[i]);
  654. }
  655. condition += "二码和:" + iskill.ToString() + "#" + str + "@";
  656. }
  657. Number.Clear();
  658. Number = tempNumber;
  659. }
  660. #endregion
  661. #region 胆码过滤
  662. private void dmFilter(string str, string str1, string str2)
  663. {
  664. ArrayList tempNumber = new ArrayList();
  665. if (string.IsNullOrEmpty(str) && string.IsNullOrEmpty(str1) && string.IsNullOrEmpty(str2))
  666. {
  667. return;
  668. }
  669. else
  670. {
  671. for (int i = 0; i < Number.Count; i++)
  672. {
  673. 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))
  674. {
  675. tempNumber.Add(Number[i]);
  676. }
  677. }
  678. condition += "胆码:" + str + "@";
  679. }
  680. Number.Clear();
  681. Number = tempNumber;
  682. }
  683. #endregion
  684. #region 号码过滤
  685. /// <summary>
  686. /// 号码过滤
  687. /// </summary>
  688. /// <param name="str">被过滤的号码</param>
  689. /// <param name="a">位数</param>
  690. /// <param name="iskill">过滤</param>
  691. private void numberFilter(string str, int a, int iskill)
  692. {
  693. ArrayList tempNumber = new ArrayList();
  694. if (string.IsNullOrEmpty(str))
  695. {
  696. return;
  697. }
  698. else
  699. {
  700. for (int i = 0; i < Number.Count; i++)
  701. {
  702. if (iskill == 0)
  703. {
  704. if (!string.IsNullOrEmpty(str) && str.Trim().IndexOf(Number[i].ToString().Substring(a, 1)) >= 0)
  705. { }
  706. else
  707. {
  708. tempNumber.Add(Number[i]);
  709. }
  710. }
  711. }
  712. if (a == 0)
  713. {
  714. condition += "杀号:" + str + "@";
  715. }
  716. }
  717. Number.Clear();
  718. Number = tempNumber;
  719. }
  720. #endregion
  721. #region 生成号码组合
  722. /// <summary>
  723. /// 生成选择的数据组合
  724. /// </summary>
  725. /// <returns>ArrayList</returns>
  726. private ArrayList numberArray()
  727. {
  728. ArrayList Number = new ArrayList();
  729. string strs = string.Empty;
  730. if (!string.IsNullOrEmpty(bwString))
  731. {
  732. strs = bwString;
  733. sourcedata = "定位:" + bwString;
  734. }
  735. if (strs.Length > 0) //根据选号生成号码
  736. {
  737. bwArray = bwString.Split(',');
  738. for (int a = 0; a < bwArray.Length; a++)
  739. {
  740. for (int b = 0; b < bwArray.Length; b++)
  741. {
  742. for (int c = 0; c < bwArray.Length; c++)
  743. {
  744. Number.Add(bwArray[a] + bwArray[b] + bwArray[c]);
  745. }
  746. }
  747. }
  748. }
  749. else if (!string.IsNullOrEmpty(dadihao)) //根据
  750. {
  751. dadihao = dadihao.Replace("\r\n", ",");
  752. dadihao = dadihao.Replace(" ", ",");
  753. dadihao = dadihao.Replace(" ", ",");
  754. string[] Numbers = dadihao.Split(',');
  755. for (int i = 0; i < Numbers.Length; i++) //去除位数不对的数据和重复的数据
  756. {
  757. int outresult;
  758. if (Numbers[i].Trim().Length == 3 && !Number.Contains(Numbers[i]) && Int32.TryParse(Numbers[i], out outresult))
  759. {
  760. Number.Add(Numbers[i]);
  761. sourcedata = sourcedata + Numbers[i] + ",";
  762. }
  763. }
  764. if (dzhixuan == 1) //用户选择了组选
  765. {
  766. ArrayList al = new ArrayList();
  767. string t1 = string.Empty;
  768. string t2 = string.Empty;
  769. string t3 = string.Empty;
  770. string t = string.Empty;
  771. for (int i = 0; i < Number.Count; i++)
  772. {
  773. t1 = Number[i].ToString().Substring(0, 1);
  774. t2 = Number[i].ToString().Substring(1, 1);
  775. t3 = Number[i].ToString().Substring(2, 1);
  776. al.Add(t1 + t2 + t3);
  777. al.Add(t1 + t3 + t2);
  778. al.Add(t2 + t1 + t3);
  779. al.Add(t2 + t3 + t1);
  780. al.Add(t3 + t1 + t2);
  781. al.Add(t3 + t2 + t1);
  782. }
  783. Number.Clear();
  784. Number = al;
  785. sourcedata = "大底#" + sourcedata;
  786. }
  787. }
  788. return Number;
  789. }
  790. #endregion
  791. #region 获取二码和差
  792. private static ArrayList GetEmHC(string str, int tp) //tp 0为和,1为差
  793. {
  794. int a, b, c;
  795. int hc1, hc2, hc3;
  796. ArrayList arr = new ArrayList();
  797. a = Convert.ToInt32(str.Substring(0, 1));
  798. b = Convert.ToInt32(str.Substring(1, 1));
  799. c = Convert.ToInt32(str.Substring(2, 1));
  800. if (tp == 0)
  801. {
  802. hc1 = a + b;
  803. hc2 = a + c;
  804. hc3 = b + c;
  805. }
  806. else
  807. {
  808. hc1 = Math.Abs(a - b);
  809. hc2 = Math.Abs(a - c);
  810. hc3 = Math.Abs(b - c);
  811. }
  812. arr.Add(hc1);
  813. if (!arr.Contains(hc2)) arr.Add(hc2);
  814. if (!arr.Contains(hc3)) arr.Add(hc3);
  815. return arr;
  816. }
  817. #endregion
  818. #region 取值
  819. private void GetValue()
  820. {
  821. //选号
  822. bwString = WRequest.GetFormString("bw");
  823. //大底
  824. dzhixuan = WRequest.GetFormInt("dzx", 0);
  825. dadihao = WRequest.GetFormString("dadihao");
  826. //号码过滤
  827. pbh = WRequest.GetFormInt("pbh", 0);
  828. pbwString = WRequest.GetFormString("pbw");
  829. //胆码过滤
  830. dbwString = WRequest.GetFormString("dbw");
  831. //012路
  832. str_012 = WRequest.GetFormString("lubl");
  833. lubh = WRequest.GetFormInt("lubh", 0);
  834. //二码过滤
  835. twoString = WRequest.GetFormString("embl").Trim();
  836. emhb = WRequest.GetFormInt("emhb", 0);
  837. //二码和过滤
  838. str_emh = WRequest.GetFormString("pemh").Trim();
  839. emhh = WRequest.GetFormInt("pemhr", 0);
  840. //二码差
  841. str_emc = WRequest.GetFormString("pemc").Trim();
  842. emch = WRequest.GetFormInt("pemcr", 0);
  843. //和值
  844. hzString = WRequest.GetFormString("hzbl").Trim();
  845. hzhb = WRequest.GetFormInt("hzhb", 0);
  846. // 和尾
  847. hwString = WRequest.GetFormString("hwbl").Trim(); ;
  848. hwhb = WRequest.GetFormInt("hwhb", 0);
  849. // 跨度
  850. kdString = WRequest.GetFormString("kdbl").Trim();
  851. kdhb = WRequest.GetFormInt("kdhb", 0);
  852. //大小
  853. dxString = WRequest.GetFormString("dxbl").Trim();
  854. dxhb = WRequest.GetFormInt("dxhb", 0);
  855. //奇偶
  856. joString = WRequest.GetFormString("jobl").Trim();
  857. johb = WRequest.GetFormInt("johb", 0);
  858. //质合
  859. zhString = WRequest.GetFormString("zhbl").Trim();
  860. zhhb = WRequest.GetFormInt("zhhb", 0);
  861. //顺子
  862. szbl = WRequest.GetFormInt("szbl", 0);
  863. //组合
  864. zuhe3 = WRequest.GetFormInt("zuhe3", 0);
  865. zuhe6 = WRequest.GetFormInt("zuhe6", 0);
  866. }
  867. #endregion
  868. }
  869. }