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 d; if (null == info || string.IsNullOrEmpty(info.ShiJiHao) || -1 != info.ShiJiHao.IndexOf("-1")) { number.AppendLine("
  • "); number.AppendLine(" ???"); number.AppendLine("
  • "); number.AppendLine("
  • 和值:-- | 跨度:-- | 奇偶比:-- | 大小比:--
  • "); } else { term = (int)info.Term; date = info.OpenTime; d = info.ShiJiHao.ToIntArray(','); number.AppendLine("
  • "); number.AppendLine(" " + d[0].ToString() + "" + d[1].ToString() + "" + d[2].ToString() + ""); number.AppendLine("
  • "); number.AppendLine("
  • 和值:" + CB.Common.LotteryUtils.GetSum(d).ToString() + " | 跨度:" + CB.Common.LotteryUtils.GetSpan(d).ToString() + " | 奇偶比:" + CB.Common.LotteryUtils.GetProportionOfJO(d) + " | 大小比:" + CB.Common.LotteryUtils.GetProportionOfDX(d, 5) + "
  • "); } 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(" "); } else { sp.AppendLine(" "); } sp.AppendLine(" " + item.Term.ToString() + ""); sp.AppendLine(" " + item.OpenTime.ToString("yyyy.MM.dd") + ""); sp.AppendLine(" " + item.ShiJiHao.Replace(",", ",") + ""); sp.AppendLine(" " + CB.Common.LotteryUtils.GetSum(d).ToString() + ""); if (0 <= item.OpenCode1) { sp.AppendLine(" " + item.OpenCode1 + "," + item.OpenCode2 + "," + item.OpenCode3 + ""); sp.AppendLine(" " + CB.Common.LotteryUtils.GetSum(item.OpenCode, 3).ToString() + ""); sp.AppendLine(" " + GetContains(item.OpenCode, item.ShiJiHao) + ""); } else { sp.AppendLine(" ---"); sp.AppendLine(" ---"); sp.AppendLine(" ---"); } sp.AppendLine(" "); 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(" "); } else { others.AppendLine(" "); } others.AppendLine(" " + item.Term.ToString() + ""); others.AppendLine(" " + item.OpenTime.ToString("yyyy.MM.dd") + ""); others.AppendLine(" " + item.ShiJiHao.Replace(",", ",") + ""); others.AppendLine(" " + CB.Common.LotteryUtils.GetSum(d).ToString() + ""); if (0 <= item.OpenCode1) { others.AppendLine(" " + item.OpenCode1 + "," + item.OpenCode2 + "," + item.OpenCode3 + ""); others.AppendLine(" " + CB.Common.LotteryUtils.GetSum(item.OpenCode, 3).ToString() + ""); others.AppendLine(" " + GetContains(item.OpenCode, item.ShiJiHao) + ""); } else { others.AppendLine(" ---"); others.AppendLine(" ---"); others.AppendLine(" ---"); } others.AppendLine(" "); i++; } } base.InitData(); } private string GetContains(IList list, string numbers) { if (null == list || 0 >= list.Count || string.IsNullOrEmpty(numbers)) return ""; if (list.Count > 3) { list = list.Take(3).ToList(); } IList 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(); } /// /// /// /// 当前类型 /// 标题最大 /// /// /// 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(hr.Html.ToString()); CacheUtils.SetCache("jsonListKJH", jsonList, new TimeSpan(0, 0, 30, 0)); } catch (Exception) { return ""; } } else { jsonList = JsonConvert.DeserializeObject(Session["jsonList"].ToString()); } if (null == jsonList) { return ""; } var sp = new StringBuilder(400 * 6); var fortstr = "
  • {1}
  • "; if (showDate) fortstr = "
  • {1}{2}
  • "; switch (indexTypes) { case "ssq": foreach (var item in jsonList.ssq) { var lst = new List() { "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() { "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() { "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() { "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() { "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(); } } }