Microsoft 365 和 Office | SharePoint | 商业版 | Windows
一组用于共享和管理内容、知识和应用程序的 Microsoft 产品和技术。
你好
如何使用 CSOM 从 c# 中的页面版本(如 1.0、2.0)Wiki 页面库中获取 wiki 内容。 没有从版本获取内容的方法。
Note:此问题总结整理于: How to get wiki content from wiki page library SharePoint 365 using C# CSOM
一组用于共享和管理内容、知识和应用程序的 Microsoft 产品和技术。
一种面向对象的类型安全的编程语言,它起源于 C 语言系列,包括对面向组件的编程的支持。
我们可以在属性中获取页面内容。version.FieldValues
using (var clientContext = new ClientContext("https://contoso.sharepoint.com/sites/dev"))
{
// SharePoint Online Credentials
clientContext.Credentials = new SharePointOnlineCredentials(userName, password);
ListItem item = clientContext.Web.Lists.GetByTitle("Site Pages").GetItemById(44);
clientContext.Load(item,li=>li.Versions);
clientContext.ExecuteQueryRetry();
foreach (ListItemVersion version in item.Versions)
{
Console.WriteLine(version.VersionLabel);
Console.WriteLine(version.FieldValues["WikiField"]);
}
Console.ReadLine();
}
测试结果: 
如果回复有帮助,请点击“接受答案”并点赞。 注意:如果您想接收此线程的相关电子邮件通知,请按照我们文档中的步骤启用电子邮件通知。