views:

102

answers:

2

hello,

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 Datei --> Eigenschaften --> "Date of Creation" i get the "right CreationTime"

greetings, Tyzak

+2  A: 

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.

marc_s
okay, thanks.thaht means i can't get the "inside" CreationTime, right?
Tyzak
depends on your Word and Excel versions. With Office 2007 and up, sure - it's all just XML! :) Check out the OpenXML SDK - e.g. here: http://openxmldeveloper.org/
marc_s
And check out this article in particular - I guess that's your creation date you're after! http://openxmldeveloper.org/archive/2006/06/30/Sanjay_and_Vijetha_from_Sonata_Software_Limited.aspx
marc_s
thanks a lot! that's very useful : )
Tyzak
A: 

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.

GraemeF
what is the second method for showing extra information that are stored inside?
Tyzak