I need to set specific time for date modified property, not current time.
I can't use FileInfo because the file is located in folder outside \AppData\Local\Packages<packagename>\LocalState (system.io has no access).
I need to set specific time for date modified property, not current time.
I can't use FileInfo because the file is located in folder outside \AppData\Local\Packages<packagename>\LocalState (system.io has no access).
UWP has
SavePropertiesAsyncmethod that could use to modify basic property, unfortunately,System.DateModifiedis Innate, so we can't update it manually in uwp platform as this answer said. For this scenario, we suggest updateFileInfouse desktop extension, for more you could refer to stefan's blog UWP with Desktop Extension. And the other way is copy the file into app's local folder, and put it back after modified propertyThe following is sample code that update LastWriteTime within desktop extension