开发者

Saving create / modify dates of file when writing / restoring a binary filestream

Is it possible to save a file's original create / modify dates when saving a file to a db (via filestream & BinaryReader) and then have those dates attached to the file when recreating the file, again via filestream & Bina开发者_运维问答ryWriter, from the db? If possible, how do I do it?

My inital research leads me to believe only the file contents are being stored and retrieved.


You can add database columns for the data you want to save about your file. When you write a file to the database, put this information into the columns. When you read, change file properties according to the data from columns.


As suggested by Athari you can store those times in database columns and when you are recreating the file use System.IO.FileInfo. You can set all the time properties using this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜