如何在SharePoint中的站点及其所有子站点中获取图像库属性?

cod*_*ter 0 sharepoint list

我在站点及其子站点中有一个图像库,我想使用SharePoint对象模型访问其属性.我不知道如何使用SharePoint对象模型实现这一目标.这是该图书馆的图像替代文字

请注意,我的SharePoint网站和子网站的结构.您可以在每个站点和子站点中看到"图像"库. 替代文字

Ash*_*int 5

所有这些属性都在SPList下可用

  using (SPSite oSPsite = new SPSite("spdev/";)) {
using (SPWeb oSPWeb = oSPsite.OpenWeb())
 { 
    SPList list = oSPWeb.GetList("PublishingImages"); 
    list.EnableModeration = true;
    if (oSPWeb.Webs.Count > 0 ) 
    {
    recursivewebcheck(oSPweb);
    }
 } 

Void recursivewebcheck(SPWeb oSPweb)
{

    foreach (SPWeb web in oSPWeb.Webs)
        { 
            SPList list = web.GetList("PublishingImages"); 
            list.EnableModeration = true; web.Dispose(); 
            if (oSPWeb.Webs.Count > 0 ) 
            {
                recursivewebcheck(web);
            }
            web.dispose();
        }

}
Run Code Online (Sandbox Code Playgroud)