static void CreateSitemap(FileItem files) { var sm = ""; foreach (var file in files.GetFiles()) { var s = file.Name.Replace(destPath, "http://www.bltoolkit.net/").Replace("\\", "/"); if (s == "http://www.bltoolkit.net/index.htm") { continue; } sm += string.Format(@" <url> <loc>{0}</loc> <lastmod>{1:yyyy-MM-dd}</lastmod> <changefreq>weekly</changefreq> </url>" , s, DateTime.Now); } using (var sw = File.CreateText(destPath + "sitemap.xml")) { sw.WriteLine(string.Format(@"<?xml version=""1.0"" encoding=""UTF-8""?> <urlset xmlns=""http://www.google.com/schemas/sitemap/0.84""> <url> <loc>http://www.bltoolkit.net/</loc> <lastmod>{0:yyyy-MM-dd}</lastmod> <changefreq>weekly</changefreq> </url>{1} </urlset>", DateTime.Now, sm)); } }
static void CreateSitemap(FileItem files) { var sm = ""; foreach (var file in files.GetFiles()) { var s = file.Name.Replace(destPath, "http://www.bltoolkit.net/").Replace("\\", "/"); if (s == "http://www.bltoolkit.net/index.htm") continue; sm += string.Format(@" <url> <loc>{0}</loc> <lastmod>{1:yyyy-MM-dd}</lastmod> <changefreq>weekly</changefreq> </url>", s, DateTime.Now); } using (var sw = File.CreateText(destPath + "sitemap.xml")) { sw.WriteLine(string.Format(@"<?xml version=""1.0"" encoding=""UTF-8""?> <urlset xmlns=""http://www.google.com/schemas/sitemap/0.84""> <url> <loc>http://www.bltoolkit.net/</loc> <lastmod>{0:yyyy-MM-dd}</lastmod> <changefreq>weekly</changefreq> </url>{1} </urlset>", DateTime.Now, sm)); } }
static void CreateProjectFile(FileItem root) { using (var sw = File.CreateText(destPath + "BLToolkit.hhp")) { sw.WriteLine("[FILES]"); foreach (var file in root.GetFiles()) { var s = file.Path; sw.WriteLine(s); } var path = Path.GetFullPath(@"..\..\..\..\Source\Doc\"); sw.WriteLine(@" [OPTIONS] Title=BLToolkit Auto Index=Yes Compatibility=1.1 or later Compiled file={0}BLToolkit.chm Default Window=MsdnHelp Default topic=Home.htm Display compile progress=No Error log file=BLToolkit.log Full-text search=Yes Index file=BLToolkit.hhk Language=0x409 English (United States) Contents file=BLToolkit.hhc [WINDOWS] MsdnHelp=""Business Logic Toolkit for .NET Help"",""BLToolkit.hhc"",""BLToolkit.hhk"",""Home.htm"",""Home.htm"",,,,,0x63520,250,0x387e,[50,25,850,625],0x1020000,,,,,,0 [INFOTYPES] ", path); } }