Friday, September 10, 2010

Listing all webpages from moss site

Listing the all the webpages from the site in MOSS 2007/sharepoint service
I used to itereate the file names using the Sharepoint Object Model's SPListItems

SPSite mySite = new SPSite("http://localhost/MurugesanSite/");
SPWeb myWeb = mySite.OpenWeb();
SPList NoOfPages= myWeb.Lists[2];
foreach(SPListItem items in NoOfPages.Items)
{
Response.Write(items.File.ToString());
}

}