2011-04-07 56 views
0

我需要更改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

如您的聲明使用

if (oList.BaseType == SPBaseType.Survey) 
相關問題