在SharePoint 2010中以编程方式列出所有调查?

时间:2011-04-07 12:19:28

标签: sharepoint sharepoint-2010

我需要更改SharePoint 2010网站集中所有调查的某些权限,如何列出它们?

例如列出我可以做的文档库

            SPSite oSiteCollection = SPContext.Current.Site;
            SPWebCollection collWebsite = oSiteCollection.AllWebs;
            foreach (SPWeb web in collWebsite)
            {
        SPListCollection collList = web.Lists;

                foreach (SPList oList in collList)
        {
                if (oList is SPDocumentLibrary)
                {
                   // Do something
                }
        }
            }

提前致谢。

1 个答案:

答案 0 :(得分:1)

使用if语句

if (oList.BaseType == SPBaseType.Survey)