SPUser Author = web.EnsureUser("YourUser");
currentItem["Author"] = Author.ID;
currentItem["Editor"] = Author.ID;
currentItem.SystemUpdate(false);
currentItem.Update().
For setting both Author and editor comment currentItem.SystemUpdate(false); in the above code.
No comments:
Post a Comment