예제 #1
0
파일: MainForm.cs 프로젝트: fangxu/TVGuide
 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
파일: MainForm.cs 프로젝트: fangxu/TVGuide
 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;
     }));
 }