C# 获取sharepoint应用程序中集合的上次修改日期

C# 获取sharepoint应用程序中集合的上次修改日期,c#,asp.net,web-services,sharepoint,soaphttpclientprotocol,C#,Asp.net,Web Services,Sharepoint,Soaphttpclientprotocol,我有一个asp.net Web Api应用程序,它通过Web服务与sharepoint应用程序通信 我添加此方法以使用http请求创建列表引用 public static SPService.Lists CreateSPServiceListsReference(HttpRequestMessage request, bool defaultEpic = true) { var login = EpicConfiguration.ExtractAuthe

我有一个asp.net Web Api应用程序,它通过Web服务与sharepoint应用程序通信

我添加此方法以使用http请求创建列表引用

 public static SPService.Lists CreateSPServiceListsReference(HttpRequestMessage request, bool defaultEpic = true)
        {
            var login = EpicConfiguration.ExtractAuthenticationParameters(request);
            var lists = new SPService.Lists(){
                Credentials = new NetworkCredential(login.Username, login.Password, login.Domain),
                Url = string.Format(SPServiceListFormat, (defaultEpic)?login.EpicWebUrl:login.RefWebUrl)

            };

            return lists;
        }
这是我第一次必须与sharepoint应用程序通信。我需要调用一个服务,该服务将列表的名称作为参数,并返回此列表中的最后修改日期。在问这个问题之前,我在谷歌上搜索了一下,但没有找到解决办法

有什么想法吗?

您可以利用SharePoint Web Services检索指定列表的架构,然后提取表示上次修改日期的
Modified
属性

示例

using (var svc = new ListsService.Lists())
{
       svc.Credentials = new NetworkCredential(userName, password, domain);
       var list = svc.GetList("Pages");
       var listXml = XElement.Parse(list.OuterXml);
       var lastModified = listXml.Attribute("Modified").Value;

}

我得到的值为
lastModified
=20140827 14:30:14,这意味着最后一次修改是在2014年!!!我需要最后一次修改值,而不是list@LamloumiAfif,是否确实为
GetList
方法指定了正确的列表名称?在提供的示例中,它从
页面
列表返回值。我不确定,但您是否可以编辑您的代码,以获得所有带有最后修改日期的列表名称?