How to edit the modified date of a folder/file?
I am creating folders in SP using webdav with HttpWebRequest, MKCOL method. And I upload files using WebClient. For both uploaded files and created folders, how can I set their modified date? I am looking for something similar to Directory.SetLastWriteTime , File.SetLastWriteTime You can use following code for that //Change the file created time. File.SetCreationTime(path, dtCreation); //Change the file modified time. File.SetLastWriteTime(path, dtModified); string path = @"c:\DirName"; Directory.SetLastWriteTime(path, DateTime.Now); dt = Directory.GetLastWriteTime(path); 来源: https:/