C# 获取SharePoint列表中某行的所有版本
我试图读取站点上列表的所有版本并存储它们。我希望对整行执行此操作,而不是逐列(或逐项)执行此操作。我在这里见过这个 但我无法理解它,因为oList、items和listItem都没有“Version”属性。我已在SharePoint中为我的列表启用版本控制。下面是我的C#代码C# 获取SharePoint列表中某行的所有版本,c#,sharepoint,sharepoint-online,C#,Sharepoint,Sharepoint Online,我试图读取站点上列表的所有版本并存储它们。我希望对整行执行此操作,而不是逐列(或逐项)执行此操作。我在这里见过这个 但我无法理解它,因为oList、items和listItem都没有“Version”属性。我已在SharePoint中为我的列表启用版本控制。下面是我的C#代码 您可以使用ListItem.Versions属性获取项目的所有版本: 另外,如果可能的话,请使用最新版本的SharePoint SDK。在此处进行评论,因为在我搜索解决方案时会弹出此答案。在另一个stackoverflo
您可以使用ListItem.Versions属性获取项目的所有版本:
另外,如果可能的话,请使用最新版本的SharePoint SDK。在此处进行评论,因为在我搜索解决方案时会弹出此答案。在另一个stackoverflow答案中已经有一个解决方案。这个答案同样适用于SP13 它基于使用:
"https://<server>/<site>/_layouts/versions.aspx?list={litsID}&ID=<itemID>"
”https:////_layouts/versions.aspx?list={litsID}&ID=”
请看
Error CS1061 'ListItemCollection' does not contain a definition
for 'Versions' and no accessible extension method 'Versions' accepting a
first argument of type 'ListItemCollection' could be found (are you missing
a using directive or an assembly reference?)
foreach (ListItem listItem in items)
{
ListItemVersionCollection itemversioncollection = listItem.Versions;
clientContext.Load(itemversioncollection);
clientContext.ExecuteQuery();
}
"https://<server>/<site>/_layouts/versions.aspx?list={litsID}&ID=<itemID>"