我是否需要有关SharePoint文档库的信息是否选中“允许管理内容类型”。我必须使用SharePoint Web服务。
我在Lists.asmx中查找了GetListAndView方法,但在“List”节点或“View”节点中没有找到引用内容类型管理的属性。
有人可以帮帮我吗?
谢谢:)
答案 0 :(得分:0)
您可以从lists.asmx的GetList()方法获取它。看看Flags属性。
的示例代码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;
}