This project is read-only.
Project Description
The library is helping to create a Google SiteMap.

Description standard http://www.sitemaps.org/

Example 1

SiteMapDocument siteMapDocument = new SiteMapDocument();
siteMapDocument.AddUrl("http://www.newslab.ru/news/", DateTime.Now, "0.8", ChangeFrequency.daily);
siteMapDocument.AddUrl("http://www.newslab.ru/review/", DateTime.Now, "0.8", ChangeFrequency.daily);

Response.Write(siteMapDocument.ToXml());

Example 2

SiteMapIndexDocument siteMapIndex = new SiteMapIndexDocument();
siteMapIndex.FileName = "MapIndex.xml";
siteMapIndex.SiteMapItems = new List<SiteMapItem>();

SiteMapItem siteMapItemDefaultPage = new SiteMapItem();
siteMapItemDefaultPage.Loc = "http://www.newslab.ru/MapDefault.xml";
siteMapItemDefaultPage.LastmodParsed = DateTime.Now;
siteMapItemDefaultPage.SiteMapDocument = new SiteMapDocument();
siteMapItemDefaultPage.SiteMapDocument.FileName = "MapDefault.xml";
siteMapItemDefaultPage.SiteMapDocument.AddUrl("http://www.newslab.ru/news/", DateTime.Now, "0.8", ChangeFrequency.daily);
siteMapItemDefaultPage.SiteMapDocument.AddUrl("http://www.newslab.ru/review/", DateTime.Now, "0.8", ChangeFrequency.daily);

siteMapIndex.SiteMapItems.Add(siteMapItemDefaultPage);

SiteMapItem siteMapItemNewsPage = new SiteMapItem();
siteMapItemNewsPage .Loc = "http://www.newslab.ru/MapNews.xml";
siteMapItemNewsPage .LastmodParsed = DateTime.Now;
siteMapItemNewsPage .SiteMapDocument = new SiteMapDocument();
siteMapItemNewsPage .SiteMapDocument.FileName = "MapNews.xml";
siteMapItemNewsPage .SiteMapDocument.AddUrl("http://newslab.ru/news/273560", DateTime.Now, "0.5", ChangeFrequency.daily);
siteMapItemNewsPage .SiteMapDocument.AddUrl("http://newslab.ru/news/273558", DateTime.Now, "0.5", ChangeFrequency.daily);

siteMapIndex.SiteMapItems.Add(siteMapItemNewsPage );

siteMapIndex.SaveAllToFile();

Last edited Oct 27, 2008 at 7:36 AM by antonko, version 4