i have some documents that has been copied in a folder.(example with word) when i use filesysteminfo.CreationTime i get the date when i copied it. (right click on the document, (last to select) "eigenschaften")
but when i go into the document and select开发者_StackOverflow中文版 Datei --> Eigenschaften --> "Date of Creation" i get the "right CreationTime"
greetings, Tyzak
When you copy the file, a new file gets created --> that's why the FileInfo.CreationTime is set to the date/time when you copied the file.
What you're seeing in the Datei/Eigenschaften is inside Word. That is data that Word keeps track of - it's not a property directly on the file, but a metadata item that Word stores inside the file (in its Word document properties subelements).
FileInfo
has three date/time stamps:
- CreationTime (when the file was physically created)
- LastAccessTime (last access to the file in any way)
- LastWriteTime (last write access to the file)
Anything more will not be handled by the file system directly.
Not sure what the question is, but the first method is giving you the create time from the file system, and the second is showing you extra information that Word has stored in the document.
精彩评论