0
SPContentTypeCollection ctc=web.ContentTypes;
string id = string.Empty;
foreach (SPContentType item in ctc)
{
if (string.Equals(item.Group.ToString(),"Custom CT"))
{
id = item.Id.ToString();
break;
}
为什么id = item.id.tostring()
无法正常工作。 if语句有问题。按组名称列出内容类型
你能详细说明你不工作的意思吗?你是否收到错误或者你没有得到正确的ID? – 2011-01-19 21:19:51