コード例 #1
0
        void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            Owner.Controls.Clear();
            TvList.Clear();
            var listStr = AES_Dec_Str(e.Result, @"其实你不用猜我没");

            if (string.IsNullOrEmpty(listStr))
            {
                return;
            }
            var lists = listStr.Split('|');

            foreach (var list in lists)
            {
                var strs = list.Split('@');
                var item = new Tv {
                    Name = strs[0], Url = strs[1]
                };
                TvList.Add(item);
            }
            if (TvList == null || TvList.Count <= 0)
            {
                MessageBox.Show(@"获取电视列表失败!");
                return;
            }
            var iNav = new Panel
            {
                Dock      = DockStyle.Top,
                Size      = new Size(1, Navheight),
                BackColor = Color.Transparent,
            };
            var iFly = new EnFlyPanel
            {
                Size      = new Size(Owner.Parent.Width - 20, Navheight),
                Location  = new Point(10, 0),
                BackColor = Color.Transparent,
            };

            foreach (var v in TvList)
            {
                var btn = new EnButton
                {
                    Size      = new Size(80, Navheight - 6),
                    ForeColor = Color.White,
                    Text      = v.Name,
                    Tag       = v.Url,
                    AutoSize  = false,
                    Font      = new Font("宋体", 12F),
                };
                iFly.Controls.Add(btn);
                btn.Click += btn_Click;
            }
            var iTv = new EnBrowser
            {
                Dock = DockStyle.Fill,
                IsWebBrowserContextMenuEnabled = false,
                ScriptErrorsSuppressed         = true,
                ScrollBarsEnabled = false,
            };

            Owner.Controls.Add(iTv);
            iNav.Controls.Add(iFly);
            Owner.Controls.Add(iNav);
            iTv.Navigate(TvList[0].Url);
        }
コード例 #2
0
 void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
 {
     Owner.Controls.Clear();
     TvList.Clear();
     var listStr = AES_Dec_Str(e.Result, @"其实你不用猜我没");
     if (string.IsNullOrEmpty(listStr))
     {
         return;
     }
     var lists = listStr.Split('|');
     foreach (var list in lists)
     {
         var strs = list.Split('@');
         var item = new Tv {Name = strs[0], Url = strs[1]};
         TvList.Add(item);
     }
     if (TvList == null || TvList.Count <= 0)
     {
         MessageBox.Show(@"获取电视列表失败!");
         return;
     }
     var iNav = new Panel
     {
         Dock = DockStyle.Top,
         Size = new Size(1,Navheight),
         BackColor = Color.Transparent,
     };
     var iFly = new EnFlyPanel
     {
         Size = new Size(Owner.Parent.Width-20, Navheight),
         Location = new Point(10, 0),
         BackColor = Color.Transparent,
     };
     foreach (var v in TvList)
     {
         var btn = new EnButton
         {
             Size = new Size(80, Navheight - 6),
             ForeColor = Color.White,
             Text = v.Name,
             Tag = v.Url,
             AutoSize = false,
             Font = new Font("宋体", 12F),
         };
         iFly.Controls.Add(btn);
         btn.Click += btn_Click;
     }
     var iTv = new EnBrowser
     {
         Dock = DockStyle.Fill,
         IsWebBrowserContextMenuEnabled = false,
         ScriptErrorsSuppressed = true,
         ScrollBarsEnabled = false,
     };
     Owner.Controls.Add(iTv);
     iNav.Controls.Add(iFly);
     Owner.Controls.Add(iNav);
     iTv.Navigate(TvList[0].Url);
 }