SubmitSitemapToSearchenginesByHttp() public method

public SubmitSitemapToSearchenginesByHttp ( ) : bool
return bool
示例#1
0
        public void RefreshSitemap(object sender, EventArgs args)
        {
            var sites = SitemapManagerConfiguration.GetSiteNames();

            foreach (var site in sites)
            {
                var config         = new SitemapManagerConfiguration(site);
                var sitemapManager = new SitemapManager(config);
                sitemapManager.SubmitSitemapToSearchenginesByHttp();

                if (!config.GenerateRobotsFile)
                {
                    continue;
                }
                sitemapManager.RegisterSitemapToRobotsFile();
            }
        }
示例#2
0
 public void RefreshSitemap(object sender, EventArgs args)
 {
     try
     {
         var sites = SitemapManagerConfiguration.GetSiteNames();
         foreach (var site in sites)
         {
             var config         = new SitemapManagerConfiguration(site);
             var sitemapManager = new SitemapManager(config);
             sitemapManager.SubmitSitemapToSearchenginesByHttp();
             //removed because now the robots is generated when it is invoked the url with robots.txt at the end
             //if (!config.GenerateRobotsFile) continue;
             //sitemapManager.RegisterSitemapToRobotsFile();
         }
     }
     catch (Exception e)
     {
         Log.Error("Error Sitemap", e, this);
     }
 }