当前位置: 首页>>代码示例>>C#>>正文


C# HtmlWeb.LoadAsync方法代码示例

本文整理汇总了C#中HtmlAgilityPack.HtmlWeb.LoadAsync方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlWeb.LoadAsync方法的具体用法?C# HtmlWeb.LoadAsync怎么用?C# HtmlWeb.LoadAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlAgilityPack.HtmlWeb的用法示例。


在下文中一共展示了HtmlWeb.LoadAsync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PhoneApplicationPage_Loaded

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb();
            htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete);

            htmlDoc.LoadAsync("http://q.cnblogs.com/");
        }
开发者ID:shandowsoftware,项目名称:cnblogs-wpapp,代码行数:7,代码来源:question.xaml.cs

示例2: FetchHtml

        public void FetchHtml(string url, Object token)
        {
            var web = new HtmlWeb();

            web.LoadAsync(url);
            web.LoadCompleted += delegate(object sender, HtmlDocumentLoadCompleted completed)
                {
                    var htmlDoc = completed.Document;

                    if (htmlDoc.ParseErrors != null && htmlDoc.ParseErrors.Count() > 0)
                    {
                        // Handle any parse errors as required

                    }
                    else
                    {
                        //foreach (var script in htmlDoc.DocumentNode.Descendants("script").ToArray())
                        //    script.Remove();
                        foreach (var style in htmlDoc.DocumentNode.Descendants("style").ToArray())
                            style.Remove();

                        if (htmlDoc.DocumentNode != null)
                        {
                            HtmlNode bodyNode = htmlDoc.DocumentNode.SelectSingleNode("//body");

                            if (bodyNode != null)
                            {
                                // Do something with bodyNode
                            }
                        }
                    }
                };
        }
开发者ID:NBitionDevelopment,项目名称:WindowsPhoneFeedBoard,代码行数:33,代码来源:DataHtmlFetcher.cs

示例3: PanoramaItem_Loaded

        private void PanoramaItem_Loaded(object sender, RoutedEventArgs e)
        {
            HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb();
            htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete);

            htmlDoc.LoadAsync("http://www.cnblogs.com/");
        }
开发者ID:shandowsoftware,项目名称:cnblogs-wpapp,代码行数:7,代码来源:MainPage.xaml.cs

示例4: StartPresentationTextRetrieval

 public void StartPresentationTextRetrieval(string url)
 {
         _hw = new HtmlWeb();
         
     _hw.LoadCompleted += hw_LoadCompleted;
     _hw.LoadAsync(url);
 }
开发者ID:darthcaedus58,项目名称:my-time-wp7,代码行数:7,代码来源:PresentationsScraper.cs

示例5: LoadFromUrl

        public override void LoadFromUrl(HtmlWeb web, String url, int pageToLoad = -1)
        {
            Url = url;
            IsLoaded = false;

            _web = web;
            _web.LoadCompleted += OnUrlLoaded;
            _web.LoadAsync(url);
        }
开发者ID:WhistMo,项目名称:OneTap_MITBBS,代码行数:9,代码来源:MitbbsTopicEssence.cs

示例6: getSearchResult

        private void getSearchResult(string searchValueHttpUri, int pageParam)
        {

            HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb();
            htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocCompleteSearch);

            htmlDoc.LoadAsync("http://zzk.cnblogs.com/s?w=" + searchValueHttpUri + "&t=b&p=" + pageParam + "");

        }
开发者ID:shandowsoftware,项目名称:cnblogs-wpapp,代码行数:9,代码来源:itemSearch.xaml.cs

示例7: PhoneApplicationPage_Loaded

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            
          
                //this.IndexPageTextBlock1.Text = "值是---------" + NavigationContext.QueryString["pageValue"];

                HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb();
                htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete);

                htmlDoc.LoadAsync("http://www.cnblogs.com/pick/");

        }
开发者ID:shandowsoftware,项目名称:cnblogs-wpapp,代码行数:12,代码来源:cream.xaml.cs

示例8: PhoneApplicationPage_Loaded

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (NavigationContext.QueryString.Count > 0)
            {
                string titleHttpUri = NavigationContext.QueryString["titleLinkValue"];
              

                HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb();

                htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete);
                htmlDoc.LoadAsync(titleHttpUri);

            }
        }
开发者ID:shandowsoftware,项目名称:cnblogs-wpapp,代码行数:14,代码来源:indexContent.xaml.cs

示例9: FetchSite

 private void FetchSite(object sender, RoutedEventArgs e)
 {
     //HtmlWeb.LoadAsync("http://www.google.com", (s, args) =>
     //                                            {
     //                                                Results.Text = String.Join(Environment.NewLine,
     //                                                                           args.Document.DocumentNode.Descendants("a").
     //                                                                            Select(
     //                                                                                x =>
     //                                                                                x.GetAttributeValue("href", "")).ToArray());
     //                                            });
     var web = new HtmlWeb();
     web.LoadCompleted += SiteLoaded;
     web.LoadAsync("http://www.google.com");
     //			HtmlWeb.LoadAsync("http://www.google.com", SiteLoaded);
 }
开发者ID:ivanovevgeny,项目名称:HtmlAgilityPack,代码行数:15,代码来源:MainPage.xaml.cs

示例10: PhoneApplicationPage_Loaded

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (NavigationContext.QueryString.Count > 0)
            {
                string titleHttpUri = NavigationContext.QueryString["titleLinkValue"];
                string questionUrl = "http://q.cnblogs.com"+titleHttpUri;
                //MessageBox.Show(questionUrl);

                HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb();

                htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete);
                htmlDoc.LoadAsync(questionUrl);

            }
        }
开发者ID:shandowsoftware,项目名称:cnblogs-wpapp,代码行数:15,代码来源:QuestionContent.xaml.cs

示例11: LoadData

        /// <summary>
        /// Creates and adds a few ItemViewModel objects into the Items collection.
        /// </summary>
        public void LoadData()
        {
            HtmlWeb webGet = new HtmlWeb();
            webGet.LoadCompleted += parse_RecallListCurrent;
            webGet.LoadAsync(Url_HealthCanadaProductRecall_2012);
            webGet.LoadAsync(Url_HealthCanadaProductRecall_2011);

            HtmlWeb fGet = new HtmlWeb();
            fGet.LoadCompleted += parse_RecallListForegin;
            fGet.LoadAsync(Url_HealthCanadaProductRecall_f2011);

            HtmlWeb cGet = new HtmlWeb();
            cGet.LoadCompleted += load_ConsumerProduct;
            cGet.LoadAsync(Url_HealthCanadaConsumer);
            /*
            HtmlWeb foodGet = new HtmlWeb();
            foodGet.LoadCompleted += load_FoodSafety;
            foodGet.LoadAsync(Url_FoodSafety);
            */
        }
开发者ID:rylan,项目名称:Canuck-Product-Safety,代码行数:23,代码来源:MainViewModel.cs

示例12: getLastestStatus

 public void getLastestStatus(string trackingnNumber)
 {
     HtmlWeb htmlWeb = new HtmlWeb();
     htmlWeb.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlWeb_LoadCompleted);
     htmlWeb.LoadAsync("http://www.verkkoposti.com/e3/TrackinternetServlet?lang=fi&LOTUS_hae=Hae&LOTUS_side=1&LOTUS_trackId=" + trackingnNumber + "&LOTUS_hae=Hae", Encoding.GetEncoding("ISO-8859-1"));
 }
开发者ID:Juggeli,项目名称:Package-Tracker,代码行数:6,代码来源:Itellanator.cs

示例13: StartDailyTextRetrieval

 /// <summary>
 /// Starts the daily text retrieval.
 /// </summary>
 /// <param name="d">The d.</param>
 public void StartDailyTextRetrieval(DateTime d)
 {
     string url = App.Settings.UseCustomDTUrl ? App.Settings.CustomDTUrl : string.Format(StringResources.Application_DailyTextURL, DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day);
     if (string.IsNullOrEmpty(url)) return;
     _hw = new HtmlWeb();
     _hw.LoadCompleted += hw_LoadCompleted;
     _hw.LoadAsync(url);
 }
开发者ID:tymiles003,项目名称:FieldService,代码行数:12,代码来源:SocietyScraper.cs

示例14: LoadFromUrl

        public virtual void LoadFromUrl(HtmlWeb web, String url, int pageToLoad = -1)
        {
            Url = url;
            IsLoaded = false;
            ClearContent();

            _pageToLoad = pageToLoad;
            _web = web;
            _web.LoadCompleted += OnUrlLoaded;
            _web.LoadAsync(url);
        }
开发者ID:WhistMo,项目名称:OneTap_MITBBS,代码行数:11,代码来源:MitbbsTopic.cs

示例15: Scrape

        public static void Scrape(object page)
        {
            _page = (MainPage)page;

            var web = new HtmlWeb();
            web.LoadCompleted += ParseBandwidthDocument;
            var settings = IsolatedStorageSettings.ApplicationSettings;
            var siteToLoad = "http://netreg.rose-hulman.edu/tools/networkUsage.pl";
            web.LoadAsync(siteToLoad,
                new UTF8Encoding(),
                (String)settings["user"],
                (String)settings["pass"],
                "rose-hulman");
        }
开发者ID:alexmullans,项目名称:Rose-HulmanUXDesign,代码行数:14,代码来源:Scraper.cs


注:本文中的HtmlAgilityPack.HtmlWeb.LoadAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。