/// <summary> /// 解析人人对象数据 /// </summary> /// <param name="celllistr"></param> /// <returns></returns> public static LiuXingData JieXiSearchData(string celllistr) { try { // if (string.IsNullOrEmpty(celllistr)) return null; var cellitem = new LiuXingData(); // 影片大类 string tempmpe = LiuXingRegex.GetSingle(celllistr, "<div id=\"location\">", "</div>"); if (!string.IsNullOrEmpty(tempmpe)) { List<string> titless = LiuXingRegex.GetValue(tempmpe, ">", "<"); if (titless.Count > 0) { if (titless.Count >= 3) { string te = titless[2]; if (!string.IsNullOrEmpty(te)) { // 大类 cellitem.Mpe = te; } } if (titless.Count >= 5) { string ye = titless[4]; if (!string.IsNullOrEmpty(ye)) { // 类型 cellitem.Typ = ye.Replace("片", ""); } } if (titless.Count >= 6) { string tt = titless[6]; if (!string.IsNullOrEmpty(tt)) { // 姓名 cellitem.Name = tt.Trim().Replace(" ", ""); } } } } // 图片 string picImg = LiuXingRegex.GetSingle(celllistr, "<div class=\"moviepic\">", "</div>"); if (!string.IsNullOrEmpty(picImg)) { string imgurl = LiuXingRegex.GetSingle(picImg, "<img src=\"", "\" title="); if (!string.IsNullOrEmpty(imgurl)) { cellitem.Img = imgurl; } } // 电影演员 var ifons = new List<string>(); string info = LiuXingRegex.GetSingle(celllistr, "<div class=\"yycon\">", "</div>"); if (!string.IsNullOrEmpty(info)) { List<string> infos = LiuXingRegex.GetValue(info, "target=\"_blank\">", "</a>"); if (infos.Count > 0) { foreach (string info1 in infos) { if (!string.IsNullOrEmpty(info1)) { ifons.Add(info1); } } if (ifons.Count > 0) { for (int i = 0; i < ifons.Count; i++) { if (i < 7) { cellitem.Car += ifons[i] + "、"; } } if (!string.IsNullOrEmpty(cellitem.Car)) { cellitem.Car = cellitem.Car.Substring(0, cellitem.Car.Length - 1); } } } } // 电影地区 string tempLoc = LiuXingRegex.GetSingle(celllistr, "<li><label>地区:</label>", "</li>"); if (!string.IsNullOrEmpty(tempLoc)) { cellitem.Loc = tempLoc.Replace(" ", "").Replace("\"", ""); } // 电影年代 string tempTim = LiuXingRegex.GetSingle(celllistr, "<li><label>年代:</label>", "</li>"); if (!string.IsNullOrEmpty(tempTim)) { cellitem.Tim = tempTim.Replace(" ", "").Replace("\"", ""); } // 电影更新 string tempUpt = LiuXingRegex.GetSingle(celllistr, "<li><label>时间:</label>", "</li>"); if (!string.IsNullOrEmpty(tempUpt)) { tempUpt = tempUpt.Replace(" ", "").Replace("\"", ""); if (!string.IsNullOrEmpty(tempUpt)) { if (tempUpt.Length >= 11) { tempUpt = tempUpt.Substring(5, 5); if (!string.IsNullOrEmpty(tempUpt)) { cellitem.Upt = tempUpt.Replace("月", "~"); } } } } // 电影质量 string tempHDs = LiuXingRegex.GetSingle(celllistr, "<li><label>版本:</label>", "</li>"); if (!string.IsNullOrEmpty(tempHDs)) { cellitem.HDs = tempHDs.Replace(" ", ""); } return cellitem; } catch (Exception exception) { MessageBox.Show(exception.Message); } return null; }
/// <summary> /// 逐个显示 /// </summary> /// <param name="tag"></param> /// <param name="img"></param> public static void DisPlayListItem(LiuXingData tag, Image img) { if (tag == null) return; // 磁贴方块 var cellpal = new EPanel { Size = new Size(406, 210), BackColor = Color.White, Tag = tag }; PublicStatic.LiuXingCon.Controls.Add(cellpal); if (!string.IsNullOrEmpty(tag.Cos)) { new HDarge( cellpal, tag.Cos, new Font(PublicStatic.SegoeFont, 12F), new Size(40, 25), new Point(-2, 44 + 24 + 45 + 25 + 20 - 135), Color.FromArgb(248, 248, 248), Color.FromArgb(0, 122, 204), ContentAlignment.MiddleCenter, AnchorStyles.Top ); } // 方块内海报 if (img != null) { var cellimg = new EPicBox { Size = new Size(150, 210), BackColor = Color.White, Image = img, SizeMode = PictureBoxSizeMode.StretchImage }; cellpal.Controls.Add(cellimg); } // 方块内文字 string tempname = tag.Name; if (!string.IsNullOrEmpty(tempname)) { if (tempname.Contains("/")) { tempname = tempname.Split("/".ToCharArray())[0]; } new HDarge( cellpal, tempname, new Font(PublicStatic.SegoeFont, 22F), new Size(244, 42), new Point(150, 10), Color.FromArgb(0, 122, 204), Color.Transparent, ContentAlignment.BottomCenter, AnchorStyles.Top ); } new HDarge( cellpal, "", new Font(PublicStatic.SegoeFont, 14F), new Size(240, 1), new Point(150 + 8, 48 + 10), Color.Transparent, Color.FromArgb(90, 122, 204), ContentAlignment.MiddleLeft, AnchorStyles.Top ); new HDarge( cellpal, "主演:" + tag.Car, new Font(PublicStatic.SegoeFont, 12F), new Size(248, 45), new Point(150 + 6, 44 + 24), Color.FromArgb(60, 60, 60), Color.Transparent, ContentAlignment.MiddleLeft, AnchorStyles.Top ); new HDarge( cellpal, "年代:" + tag.Tim, new Font(PublicStatic.SegoeFont, 12F), new Size(120, 25), new Point(150 + 6, 44 + 24 + 45), Color.FromArgb(60, 60, 60), Color.Transparent, ContentAlignment.MiddleLeft, AnchorStyles.Top ); new HDarge( cellpal, "地区:" + tag.Loc, new Font(PublicStatic.SegoeFont, 12F), new Size(120, 25), new Point(150 + 6 + 120, 44 + 24 + 45), Color.FromArgb(60, 60, 60), Color.Transparent, ContentAlignment.MiddleLeft, AnchorStyles.Top ); new HDarge( cellpal, "类型:" + tag.Typ, new Font(PublicStatic.SegoeFont, 12F), new Size(120, 25), new Point(150 + 6, 44 + 24 + 45 + 25), Color.FromArgb(60, 60, 60), Color.Transparent, ContentAlignment.MiddleLeft, AnchorStyles.Top ); new HDarge( cellpal, "更新:" + tag.Upt, new Font(PublicStatic.SegoeFont, 12F), new Size(120, 25), new Point(150 + 6 + 120, 44 + 24 + 45 + 25), Color.FromArgb(60, 60, 60), Color.Transparent, ContentAlignment.MiddleLeft, AnchorStyles.Top ); // 方块内按钮 string temphds = tag.HDs; if (string.IsNullOrEmpty(temphds)) return; var playbtn = new LButton ( cellpal, 1, temphds, new Font(PublicStatic.SegoeFont, 12.5F), new Size(101, 32), new Point(150 + 152, 40 + 25*5 + 2*5), Color.FromArgb(0, 122, 204), Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), Color.FromArgb(0, 122, 204), Color.FromArgb(0, 122, 204), Color.FromArgb(248, 248, 248), AnchorStyles.Top ); var copybtn = new LButton ( cellpal, 1, "复制链接", new Font(PublicStatic.SegoeFont, 12.5F), new Size(101, 32), new Point(150 + 152 - 101 - 8, 40 + 25*5 + 2*5), Color.FromArgb(0, 122, 204), Color.FromArgb(248, 248, 248), Color.FromArgb(248, 248, 248), Color.FromArgb(0, 122, 204), Color.FromArgb(0, 122, 204), Color.FromArgb(248, 248, 248), AnchorStyles.Top ); copybtn.MouseClick += Copybtn_MouseClick; playbtn.MouseClick += Playbtn_MouseClick; if (string.IsNullOrEmpty(PublicStatic.SearchBox.Text)) { PublicStatic.LiuXingCon.Focus(); } }