How to get the web templates available to create the subsites


using
System;
using
System.Linq;
using
System.Text;
using
Microsoft.SharePoint;
namespace
SiteTemplates
{
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite("http://serverName:1111/sites/Publishing/"))
{
using (SPWeb web = site.RootWeb)
{
//How to get the web templates available to create the subsites
SPWebTemplateCollection templateCollection =web.GetAvailableWebTemplates(site.RootWeb.RegionalSettings.LocaleId);
foreach (SPWebTemplate webTemplate in templateCollection)
{
Console.WriteLine(webTemplate.Title);
}
}
Console.ReadLine();
}
}
}
}