To Enumerate all items in all document libraries on certain site.
SPSite site = new SPSite(http://localhost/home);
SPWeb web = site.OpenWeb();
foreach (SPList doc in web.Lists) // looping on all libraries on certain site
{
if (doc.BaseType.ToString()=="DocumentLibrary") // checking that type of the library is Document Library
{
foreach (SPListItem item in doc.Items) //looping on all items on certain Document Library.
{
// use item object to get the data about each item in the Document Library
}
}
}