-
StackOverflow 文档
-
sharepoint 教程
-
使用托管客户端对象模型(CSOM)
-
项目。使用列表项集合位置检索项目
ClientContext clientContext = new ClientContext(siteUrl);
SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements");
ListItemCollectionPosition itemPosition = null;
while (true)
{
CamlQuery camlQuery = new CamlQuery();
camlQuery.ListItemCollectionPosition = itemPosition;
camlQuery.ViewXml = "<View><ViewFields><FieldRef Name='ID'/>" +
"<FieldRef Name='Title'/><FieldRef Name='Body'/>" +
"</ViewFields><RowLimit>5</RowLimit></View>";
ListItemCollection collListItem = oList.GetItems(camlQuery);
clientContext.Load(collListItem);
clientContext.ExecuteQuery();
itemPosition = collListItem.ListItemCollectionPosition;
foreach (ListItem oListItem in collListItem)
{
Console.WriteLine("Title: {0}: \nBody: {1}", oListItem["Title"], oListItem["Body"]);
}
if (itemPosition == null)
{
break;
}
Console.WriteLine("\n" + itemPosition.PagingInfo + "\n");
}