Hey,
So I'm writing a console application that copies Documents from one library to another. It's important to the client that the "ModifiedBy" and "CreatedBy" columns match eachother in the source and destination. However while it may say
that the system account was the last user to modify a particular document, when I access the value from the API it's listing a different user. Here's a sample of code:
List<SPFileVersion> Versions = SourceFile.Versions.Cast<SPFileVersion>().OrderBy(ver => ver.VersionLabel).ToList();
foreach (SPFileVersion version in Versions)
{
SPUser Creator = version.Properties["vti_author"];
SPUser Modifier = version.Properties["vti_modifiedby"];
DateTime Creation = version.File.TimeCreated;
DateTime Modification = (DateTime)version.Properties["vti_timelastmodified"];
CurrFolder.Files.Add(SourceFile.Name, version.OpenBinary(), Creator, Modifier, Creation, Modification);
}
Any ideas as to why the API and the UI are showing different values?