[英]Get if “Allow management of content types” is checked using SharePoint WebServices
無論是否選中“允許管理內容類型”,我都需要有關SharePoint文檔庫的信息。 我必須使用SharePoint Web服務。
我在Lists.asmx中的GetListAndView方法中進行了查找,但是在“列表”節點或“視圖”節點中未找到引用內容類型管理的屬性。
有人可以幫我嗎?
謝謝 :)
您可以從list.asmx的GetList()方法獲取它。 查看Flags屬性。
更好的是,這是來自https://social.technet.microsoft.com/Forums/sharepoint/zh-CN/9d6c26a5-279e-4f4e-8dfc-b31acff81813/web-service-to-check-if-the-的一些示例代碼允許進行內容類型管理?forum = sharepointgeneralprevious
public static bool GetAllowContentTypes(string listName)
{
listservice.Lists ls = new listservice.Lists();
ls.Url = "http://basesmc2008/_vti_bin/lists.asmx";
ls.UseDefaultCredentials = true;
UInt64 flags = 0;
bool contentTypesAllowed = false;
XmlNode node = ls.GetList(listName);
XElement element = XElement.Parse(node.OuterXml);
var result = from e in element.Attributes("Flags")
select e.Value;
if (result != null && UInt64.TryParse(result.First().ToString(), out flags))
contentTypesAllowed = ((flags & ((ulong)0x400000L)) != 0L);
else
return false;
return contentTypesAllowed;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.