Referencing SharePoint SPWeb.Webs
The SPWeb.Webs property of the SPWebmethod is designed to return all websites under main site. However, if you want to return all of the children of those sites, you may use AllWebs property of the SPSite. The SPWeb.Webs excludes all children of those sites.
However, you can utilize SPWeb.Webs in order to get all the children with the help of recursion. This is something you can do but can always call on SPSite.AllWebs property of the SPSite.
Here an example of how SPWeb.Webs can be used in the SharePoint.
using System; using Microsoft.SharePoint; namespace contentTypeTest { class SharePointApp { static void Main(string[] args) { using (SPSite site = new SPSite(“http://mysite”)) { SPWebCollection webs = outerWeb.Webs; foreach(SPWeb web in webs) { using(web) { … } } } } } Note that Disposal of the objects are taking care of with the help of using statement.