如何获取 SharePoint 列表 (SPList) 的上次修改日期
我有一些代码可以复制 SharePoint 2007 中新网站的列表模板文件。它检查 SPList.LastItemModified
以查看是否有新闻条目,以便知道是否创建新的 .STP
文件。
我还希望能够查看列表是否被修改,例如视图和列等。
任何人都可以帮我解决这个问题吗?谢谢。
I have some code which replicates list templates files for new sites in SharePoint 2007. It checks the SPList.LastItemModified
to see if there are news entries in order to know whether or not to create a new .STP
file.
What I would like though to also be able to see if the list was modified, for example the views and columns, etc.
Can anyone help me out with this? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它看起来像 SPList。 LastItemModifiedDate 是您想要的值。
根据 MSDN:
(强调我的)
所以它不仅仅是最后一次修改的项目,它是列表最后一次修改的时间。
为了确认这一点,我查看了一个列表,根据所有网站内容,该列表的最后修改时间是 4 小时前(该列表每晚由计时器作业更新)。但是,任何列表项的最大修改日期是 15 小时前。然后,我查看了 viewlsts.aspx 以了解如何在“所有网站内容”页面上计算“上次修改时间”,并发现以下内容:
因此,我将使用
SPList.LastItemModifiedDate
来确定上次修改列表的时间,但是它对于检索最后修改的列表项的日期并不可靠。It looks like SPList.LastItemModifiedDate is the value that you want.
According to MSDN:
(emphasis mine)
So it is more than just the last item modified, it is the last time the list was modified.
In order to confirm, I looked at a list that, according to All Site Content, was last modified 4 hours ago (the list is updated each night by a timer job). However, the greatest modified date of any list item was 15 hours ago. I then looked at viewlsts.aspx to see how Last Modified is calculated on the All Site Content page and found the following:
So I would use
SPList.LastItemModifiedDate
to determine the last time the list was modified, but it is not reliable for retrieving the date of the last list item modified.