SPListItem.Update() 与 SPListItem.SystemUpdate()区别
生活随笔
收集整理的這篇文章主要介紹了
SPListItem.Update() 与 SPListItem.SystemUpdate()区别
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
大家在SharePoint開發方面都用過SPListItem.Update 方法,不過您可能沒有用過SPListItem.SystemUpdate方法,現在來介紹一下這兩個方法的區別;
先看一下SDK中的說明:- SPListItem.Update, Updates the database with changes that are made to the list item.;
- SPListItem.SystemUpdate, Updates the database with changes that are made to the list item, without effecting changes in the Modified Time or Modified By fields.
??? 從SDK的說明中可以看出,兩個方法都是將SPListItem的更改保存到數據庫,但Update方法會更新修改時間(=當前時間)、修改者(=當前用戶),如果此列表啟用了版本控制功能,Update方法還會影響Item的版本,而SPListItem.SystemUpdate方法則不會影響修改時間和修改者,在調用SystemUpdate方法時還可以使用參數來控制是否創建新版本。
轉載于:https://www.cnblogs.com/luofeng99/archive/2011/05/20/2177611.html
總結
以上是生活随笔為你收集整理的SPListItem.Update() 与 SPListItem.SystemUpdate()区别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 歼20与歼16产能创新高!
- 下一篇: 我国的高超音速导弹可能不止一款东风17