示例#1
0
 List<TVItem>[] getTVItem(TV tv)
 {
     List<TVItem>[] week = new List<TVItem>[7];
     String[] weekUrl = tv.getWeekUrl();
     week[currentWeek] = parserTVItem(weekUrl[currentWeek]);
     return week;
 }
示例#2
0
 void initTVs()
 {
     String temp = getHtml(allUrl);
     data = new List<Dictionary<String, List<TV>>>();
     String kindP = @"listmenu""[\s\S]*?border2";
     MatchCollection matches = Regex.Matches(temp, kindP);
     Dictionary<String, List<TV>> l = null;
     List<TV> ll = null;
     foreach (Match m in matches)
     {
         l = new Dictionary<String, List<TV>>();
         String channelP = @"graytxt""><img[\s\S]*?</table>";
         MatchCollection ms = Regex.Matches(m.Value, channelP);
         foreach (Match mm in ms)
         {
             ll = new List<TV>();
             TV tv = null;
             String TVP = @"td[\s\S]*?href=""([\s\S]*?)"">([\s\S]*?)<";
             MatchCollection mss = Regex.Matches(mm.Value, TVP);
             foreach (Match mmm in mss)
             {
                 tv = new TV();
                 tv.Url = striphtml(mmm.Groups[1].Value);
                 tv.Name = mmm.Groups[2].Value;
                 ll.Add(tv);
             }
             Match m1 = Regex.Match(mm.Value, @"nbsp;([\s\S]*?)<");
             l.Add(m1.Groups[1].Value, ll);
         }
         data.Add(l);
     }
     this.BeginInvoke(new MethodInvoker(() =>
     {
         ToolStripKind_Click("央视", null);
         toolStripButtonUpdate.Enabled = true;
     }));
 }