Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sharepoint 2016内部部署详细信息项目版本字段信息_Sharepoint_Sharepoint 2016 - Fatal编程技术网

Sharepoint 2016内部部署详细信息项目版本字段信息

Sharepoint 2016内部部署详细信息项目版本字段信息,sharepoint,sharepoint-2016,Sharepoint,Sharepoint 2016,我正在SharePoint 2016 CSOM上工作,以获取列表项版本历史记录。不幸的是,我没有得到字段值。请在下面查找代码 var file = item.File; var versionFiles = file.Versions; var fa = file.ListItemAllFields; clientContext.Load(fa); clientContext.Load

我正在SharePoint 2016 CSOM上工作,以获取列表项版本历史记录。不幸的是,我没有得到字段值。请在下面查找代码

       var file = item.File;
            var versionFiles = file.Versions;
            var fa = file.ListItemAllFields;

            clientContext.Load(fa);
            clientContext.Load(file);
            clientContext.Load(versionFiles);
            clientContext.ExecuteQuery();


            if (null != versionFiles)
            {
                var fileVersion = file.Versions[5];
                SP.File oldFile =web.GetFileByServerRelativeUrl("/sites/site/_vti_history/1234/list1/file1.pdf");
                var allField = oldFile.ListItemAllFields;
                clientContext.Load(allField);


             }

您可以从Lists.asmx获取版本历史元数据

示例代码:

var web = clientContext.Web;
                List spList = clientContext.Web.Lists.GetByTitle("MyDoc");                
                var item = spList.GetItemById(43);
                clientContext.Load(spList);
                clientContext.Load(item);
                clientContext.ExecuteQuery();

                #region customList
                Lists.Lists listService = new Lists.Lists();
                listService.Credentials = System.Net.CredentialCache.DefaultCredentials;

                listService.Url = siteUrl + "/_vti_bin/lists.asmx";
                XmlNode nodeAttachments = listService.GetVersionCollection(spList.Id.ToString(), item.Id.ToString(), "Title");

                foreach (System.Xml.XmlNode xNode in nodeAttachments)
                {
                    Console.WriteLine(xNode.Attributes["Title"].Value);
                }

非常感谢。它是否提供版本历史记录中的所有字段或指定字段仅针对特定字段,需要调用listService.GetVersionCollection(spList.Id.ToString(),item.Id.ToString(),“FieldName”);获取其他字段。谢谢。我们可以在c中使用http客户端调用“/\u vti\u bin/lists.asmx”吗?将服务引用为Web服务将很简单。如果通过httprequest调用web服务,则必须构造soap。我正在尝试使用.NETCore中的共享点web服务。你知道如何添加网络参考吗