Example #1
0
        private async Task <List <TagImg> > SearchBingImage(string keyword, int page = 1)
        {
            List <TagImg> searchImgList = new List <TagImg>();
            var           start         = 1;

            if (page > 1)
            {
                start = page * PageImageNum + 1;
            }
            var url = UrlUtil.CNBingImageDetailUrl.Replace("[keyword]", keyword).Replace("[start]", start.ToString());

            searchImgList = await HtmlAgilityPackUtil.GetBingImgFromUrlAsync(url);

            return(searchImgList);
        }
Example #2
0
        private async void LoadHotSpots()
        {
            //不加载
            if (this.grid_Content.Children.Count > 0)
            {
                return;
            }

            List <TagImg> hotSpotsImgList = new List <TagImg>();

            this.Dispatcher.BeginInvoke(new Action(() => {
                dialog = new WaitingDailog("正在加载每日热图");
                dialog.ShowDialog();
            }));

            hotSpotsImgList = await HtmlAgilityPackUtil.GetBingImgFromUrlAsync(UrlUtil.CNBingImageUrl, true);

            //去除
            hotSpotsImgList = hotSpotsImgList.Where(x => x.Src.Contains("tse1-mm")).ToList();

            //显示
            ShowImage(hotSpotsImgList, true);
            dialog.Close();
        }