SPWebApplication webApplication = SPContext.Current.Site.WebApplication;
using (SPSiteCollection siteCollections = webApplication.Sites)
{
foreach (SPSite siteCollection in siteCollections)
{
Label1.Text += siteCollection.Url + “<BR>”;
siteCollection.Close();
}
}
Note : To run the above code reference the Microsoft.SharePoint.Administration.SPWebApplication assembly in your code.
Ads by Google
No comments:
Post a Comment