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); } }