How to edit the modified date of a folder/file?

后端 未结 2 1760
孤独总比滥情好
孤独总比滥情好 2021-01-22 09:26

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

2条回答
  •  半阙折子戏
    2021-01-22 09:38

    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);
    

提交回复
热议问题