-
StackOverflow 文档
-
sharepoint 教程
-
使用托管客户端对象模型(CSOM)
-
名单。从网站检索列表字段
ClientContext clientContext = new ClientContext(siteUrl);
Web oWebsite = clientContext.Web;
ListCollection collList = oWebsite.Lists;
IEnumerable<SP.List> listInfo = clientContext.LoadQuery(
collList.Include(
list => list.Title,
list => list.Fields.Include(
field => field.Title,
field => field.InternalName)));
clientContext.ExecuteQuery();
foreach (SP.List oList in listInfo)
{
FieldCollection collField = oList.Fields;
foreach (SP.Field oField in collField)
{
Regex regEx = new Regex("name", RegexOptions.IgnoreCase);
if (regEx.IsMatch(oField.InternalName))
{
Console.WriteLine("List: {0} \n\t Field Title: {1} \n\t Field Internal Name: {2}",
oList.Title, oField.Title, oField.InternalName);
}
}
}