示例#1
0
 private void SaveSitemap()
 {
     try
     {
         string sitemapPath = string.Format("{0}/{1}sitemap.xml", _options.FolderPath, DateTime.Now.ToString("dd-MM-yyyy"));
         using (var fileStream = new FileStream(sitemapPath, FileMode.Create))
         {
             var siteMapGenerator = new SiteMapGenerator(fileStream, Encoding.UTF8);
             siteMapGenerator.Generate(pagesVisited);
             siteMapGenerator.Close();
         }
         logger.Info("SiteMap save to {0}", sitemapPath);
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
示例#2
0
 private void SaveSitemap()
 {
     try
     {
         string sitemapPath = string.Format("{0}/{1}sitemap.xml", _options.FolderPath, DateTime.Now.ToString("dd-MM-yyyy"));
         using (var fileStream = new FileStream(sitemapPath, FileMode.Create))
         {
             var siteMapGenerator = new SiteMapGenerator(fileStream, Encoding.UTF8);
             siteMapGenerator.Generate(pagesVisited);
             siteMapGenerator.Close();
         }
         logger.Info("SiteMap save to {0}", sitemapPath);
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }