Filesysteminfo 获取创建日期

发布于 2024-08-18 05:23:58 字数 199 浏览 4 评论 0原文

我有一些文档已复制到文件夹中。(以word为例) 当我使用 filesysteminfo.CreationTime 时,我得到复制它的日期。 (右键单击文档,(最后选择)“eigenschaften”)

但是当我进入文档并选择 Datei --> Eigenschaften --> “创建日期” 我收到“正确的创建时间”的

问候, 蒂扎克

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清晨说晚安 2024-08-25 05:23:58

当您复制文件时,会创建一个新文件 -->这就是为什么 FileInfo.CreationTime 设置为复制文件时的日期/时间。

您在 Datei/Eigenschaften 中看到的内容就在 Word 中。这是 Word 跟踪的数据 - 它不是直接在文件上的属性,而是 Word 存储在文件内的元数据项(在其 Word 文档属性子元素中)。

FileInfo 具有三个日期/时间戳:

  • CreationTime(物理创建文件的时间)
  • LastAccessTime(最后一次以任何方式访问文件)
  • LastWriteTime(最后一次对文件的写访问)

任何其他时间都不会被处理直接通过文件系统。

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.

不确定问题是什么,但第一种方法是为您提供文件系统的创建时间,第二种方法是向您显示 Word 存储在文档中的额外信息。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文