123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Text;
- using CB.Common;
- using CB.Entity;
- using CB.Framework;
- using CB.Web.Kjh.AppCode;
- using Newtonsoft.Json;
- using HttpCodeLib;
- namespace CB.Web.Kjh.shijihao
- {
- public partial class p3sjh : WebPage
- {
- protected int term;
- protected DateTime date = DateTime.Now;
- protected StringBuilder sp = new StringBuilder();
- protected StringBuilder others = new StringBuilder();
- protected StringBuilder number = new StringBuilder();
- protected void Page_Load(object sender, EventArgs e)
- {
- InitData();
- }
- protected override void InitData()
- {
- term = WRequest.GetQueryInt("term");
- if (0 < term)
- {
- pageTitle = term.ToString() + "期排列三试机号_" + term.ToString() + "期排列3|P3试机号查询 -开奖助手";
- pageKeyWords = term.ToString() + "期排列三试机号," + term.ToString() + "期排列3|P3试机号查询";
- pageDescription = "开奖助手提供排列三" + term.ToString() + "期试机号,包括" + term.ToString() + "期排列3|P3试机号查询、" + term.ToString() + "期排列3试机号与开奖号的关系、" + term.ToString() + "期排列三试机号关注号|对应码|金码,查询体彩排列三试机号就上开奖助手。";
- }
- else
- {
- pageTitle = "排列三试机号_p3试机号_排三试机号_排3试机号_排列3试机号_体彩试机号_开奖助手";
- pageKeyWords = "排列三试机号,p3试机号,排三试机号,排列3试机号,排3试机号,_排列三试机号近十期,体彩试机号,shijihao,体彩排列3试机号,体彩排列三试机号,排三近十期试机号";
- pageDescription = "开奖助手提供最新的体彩排列三试机号、排三试机号今天、P3试机号查询、排列3试机号分析和排列三试机号近十期详细数据,并有排列三试机号走势图供彩民使用";
- }
- var info = CB.Data.Caches.GetTCP3Info(term, OpenCodeType.ShiJiHao);
- IList<int> d;
- if (null == info || string.IsNullOrEmpty(info.ShiJiHao) || -1 != info.ShiJiHao.IndexOf("-1"))
- {
- number.AppendLine("<li class=\"ballbox\">");
- number.AppendLine(" <span class=\"ball wred-40\">?</span><span class=\"ball wred-40\">?</span><span class=\"ball wred-40\">?</span>");
- number.AppendLine(" </li>");
- number.AppendLine(" <li>和值:-- | 跨度:-- | 奇偶比:-- | 大小比:-- </li>");
- }
- else
- {
- term = (int)info.Term;
- date = info.OpenTime;
- d = info.ShiJiHao.ToIntArray(',');
- number.AppendLine("<li class=\"ballbox\">");
- number.AppendLine(" <span class=\"ball wred-40\">" + d[0].ToString() + "</span><span class=\"ball wred-40\">" + d[1].ToString() + "</span><span class=\"ball wred-40\">" + d[2].ToString() + "</span>");
- number.AppendLine(" </li>");
- number.AppendLine(" <li>和值:" + CB.Common.LotteryUtils.GetSum(d).ToString() + " | 跨度:" + CB.Common.LotteryUtils.GetSpan(d).ToString() + " | 奇偶比:" + CB.Common.LotteryUtils.GetProportionOfJO(d) + " | 大小比:" + CB.Common.LotteryUtils.GetProportionOfDX(d, 5) + " </li>");
- }
- var list = CB.Data.Caches.GetTCP3List(10, OpenCodeType.ShiJiHao);
- if (null != list && 0 < list.Count)
- {
- int i = 1;
- foreach (var item in list)
- {
- d = item.ShiJiHao.ToIntArray(',');
- if (null == d)
- break;
- if (0 == i % 2)
- { sp.AppendLine(" <tr class=\"bg_grey\">"); }
- else
- { sp.AppendLine(" <tr>"); }
- sp.AppendLine(" <td>" + item.Term.ToString() + "</td>");
- sp.AppendLine(" <td>" + item.OpenTime.ToString("yyyy.MM.dd") + "</td>");
- sp.AppendLine(" <td><span>" + item.ShiJiHao.Replace(",", ",") + "</span></td>");
- sp.AppendLine(" <td>" + CB.Common.LotteryUtils.GetSum(d).ToString() + "</td>");
- if (0 <= item.OpenCode1)
- {
- sp.AppendLine(" <td>" + item.OpenCode1 + "," + item.OpenCode2 + "," + item.OpenCode3 + "</td>");
- sp.AppendLine(" <td>" + CB.Common.LotteryUtils.GetSum(item.OpenCode, 3).ToString() + "</td>");
- sp.AppendLine(" <td>" + GetContains(item.OpenCode, item.ShiJiHao) + "</td>");
- }
- else
- {
- sp.AppendLine(" <td>---</td>");
- sp.AppendLine(" <td>---</td>");
- sp.AppendLine(" <td>---</td>");
- }
- sp.AppendLine(" </tr>");
- i++;
- }
- }
- list = CB.Data.Caches.GetTCP3HistorySameTerm(term, OpenCodeType.ShiJiHao);
- if (null != list && 0 < list.Count)
- {
- int i = 1;
- foreach (var item in list)
- {
- d = item.ShiJiHao.ToIntArray(',');
- if (null == d)
- break;
- if (0 == i % 2)
- { others.AppendLine(" <tr class=\"bg_grey\">"); }
- else
- { others.AppendLine(" <tr>"); }
- others.AppendLine(" <td>" + item.Term.ToString() + "</td>");
- others.AppendLine(" <td>" + item.OpenTime.ToString("yyyy.MM.dd") + "</td>");
- others.AppendLine(" <td><span>" + item.ShiJiHao.Replace(",", ",") + "</span></td>");
- others.AppendLine(" <td>" + CB.Common.LotteryUtils.GetSum(d).ToString() + "</td>");
- if (0 <= item.OpenCode1)
- {
- others.AppendLine(" <td>" + item.OpenCode1 + "," + item.OpenCode2 + "," + item.OpenCode3 + "</td>");
- others.AppendLine(" <td>" + CB.Common.LotteryUtils.GetSum(item.OpenCode, 3).ToString() + "</td>");
- others.AppendLine(" <td>" + GetContains(item.OpenCode, item.ShiJiHao) + "</td>");
- }
- else
- {
- others.AppendLine(" <td>---</td>");
- others.AppendLine(" <td>---</td>");
- others.AppendLine(" <td>---</td>");
- }
- others.AppendLine(" </tr>");
- i++;
- }
- }
- base.InitData();
- }
- private string GetContains(IList<int> list, string numbers)
- {
- if (null == list || 0 >= list.Count || string.IsNullOrEmpty(numbers))
- return "";
- if (list.Count > 3)
- {
- list = list.Take(3).ToList();
- }
- IList<int> d = numbers.ToIntArray(',');
- if (null == d || 0 >= d.Count)
- return "";
- int i = 0;
- foreach (var item in d)
- {
- if (list.Contains(item))
- i++;
- }
- return 0 == i ? "" : i.ToString();
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="indexType">当前类型 </param>
- /// <param name="maxLength">标题最大</param>
- /// <param name="wap"></param>
- /// <param name="showDate"></param>
- /// <returns></returns>
- protected string GetSynArticleZx(string indexTypes, int maxLength, bool wap, bool showDate = false)
- {
- //jsonList.Data
- //var list = CB.Data.Synchronize.Article.GetArticleList(topSize, pageSize, cid, wap);
- dynamic jsonList;
- if (null == Session["jsonList"])
- {
- Session.Timeout = 50;
- //开始调用
- HttpHelpers hhs = new HttpHelpers();
- HttpItems hi = new HttpItems();
- string getZX = System.Configuration.ConfigurationManager.AppSettings["getZX"];
- hi.URL = getZX + "/zx/TopicInterface/GetNewList128";
- hi.Method = "get";
- hi.Accept = "/";
- hi.ContentType = "";
- hi.Timeout = 300000;
- HttpResults hr = hhs.GetHtml(hi);
- try
- {
- jsonList = JsonConvert.DeserializeObject<dynamic>(hr.Html.ToString());
- CacheUtils.SetCache("jsonListKJH", jsonList, new TimeSpan(0, 0, 30, 0));
- }
- catch (Exception)
- {
- return "";
- }
- }
- else
- {
- jsonList = JsonConvert.DeserializeObject<dynamic>(Session["jsonList"].ToString());
- }
- if (null == jsonList)
- {
- return "";
- }
- var sp = new StringBuilder(400 * 6);
- var fortstr = "<li><a href=\"{0}\" target=\"_blank\">{1}</a><span></span></li>";
- if (showDate)
- fortstr = "<li><a href=\"{0}\" target=\"_blank\">{1}</a><span class=\"time\">{2}</span></li>";
- switch (indexTypes)
- {
- case "ssq":
- foreach (var item in jsonList.ssq)
- {
- var lst = new List<object>() { "http://zx.55128.cn" + item.SourceUrl, CB.Common.Utils.GetSubString(item.title.ToString(), maxLength, "") };
- if (showDate)
- lst.Add(item.createTime.ToString("MM-dd"));
- sp.AppendFormat(fortstr, lst.ToArray());
- }
- break;
- case "fc3d":
- foreach (var item in jsonList.fc3d)
- {
- var lst = new List<object>() { "http://zx.55128.cn" + item.SourceUrl, CB.Common.Utils.GetSubString(item.title.ToString(), maxLength, "") };
- if (showDate)
- lst.Add(item.createTime.ToString("MM-dd"));
- sp.AppendFormat(fortstr, lst.ToArray());
- }
- break;
- case "dlt":
- foreach (var item in jsonList.dlt)
- {
- var lst = new List<object>() { "http://zx.55128.cn" + item.SourceUrl, CB.Common.Utils.GetSubString(item.title.ToString(), maxLength, "") };
- if (showDate)
- lst.Add(item.createTime.ToString("MM-dd"));
- sp.AppendFormat(fortstr, lst.ToArray());
- }
- break;
- case "p3": //3D试机号
- foreach (var item in jsonList.p3)
- {
- var lst = new List<object>() { "http://zx.55128.cn" + item.SourceUrl, CB.Common.Utils.GetSubString(item.title.ToString(), maxLength, "") };
- if (showDate)
- lst.Add(item.createTime.ToString("MM-dd"));
- sp.AppendFormat(fortstr, lst.ToArray());
- }
- break;
- case "sjh":
- foreach (var item in jsonList.p3)
- {
- var lst = new List<object>() { "http://zx.55128.cn" + item.SourceUrl, CB.Common.Utils.GetSubString(item.title.ToString(), maxLength, "") };
- if (showDate)
- lst.Add(item.createTime.ToString("MM-dd"));
- sp.AppendFormat(fortstr, lst.ToArray());
- }
- break;
- default:
- break;
- }
- return sp.ToString();
- }
- }
- }
|