简体   繁体   English

Sharepoint2010。Api。 如何获得田野历史?

[英]Sharepoint 2010. Api. How to get field history?

I have SPListItem and some text field. 我有SPListItem和一些文本字段。 I need in code get all versions of this field EX: 我需要在代码中获取该字段EX的所有版本:

  1. version 1 "hello rorld" 版本1“ hello rorld”
  2. version 2 "hello world" 版本2“ hello world”
  3. version 3 "new application" 版本3“新应用程序”

Any examples how to do that? 有任何示例该怎么做?

Try this: 尝试这个:

foreach (SPListItemVersion version in item.Versions)
{
    Console.WriteLine(string.Format(
        "{0}. version {0} \"{1}\"", 
        version.VersionId, version["this field"]));
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM