p3ss_post.aspx.cs 34 KB

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