问题描述
大家好,
有人可以帮我编程一个应用程序,它可以更改标准文件属性的值,尤其是关键字吗?
我试图建立一个使用Microsoft的dso.dll的名称.在32位操作系统上可以,但是不支持PDF.
在一个新项目中,我从ole32.dll实现了两个接口(StgCreateStorageEx,StgOpenStorageEx).在32位操作系统下,它适用于每种数据类型,但在64位操作系统下,它不支持PDF.
有人可以帮我吗?
谢谢
邮编:
我不想创建一个新的PDF,只需在其中添加一个属性,因为DateCreated值必须与开始时的相同.
Hello guys,
Could someone help me to program an application, which could change the value of the standard file properties, expecially keywords?
I tried to build an applikation to use the dso.dll from Microsoft; under 32-bit OS it''s OK, but has no PDF support.
In a new project i implement two interfaces (StgCreateStorageEx, StgOpenStorageEx) from the ole32.dll. Under a 32-bit OS it works very well for each datatype, but under a 64-bit OS it doesn''t have PDF support.
Could someone help me?
Thank you
P.S.:
I don´t want to create a new PDF just add an Property to it, because the DateCreated Value must be the same as at the beginning.
推荐答案
FileInfo [] fi = di.GetFiles("*.*", SearchOption.AllDirectories);
foreach (FileInfo file in fi)
{
file.CreationTime = dt;
file.LastAccessTime = dt;
file.LastWriteTime = dt;
}
请参阅评论部分中的罗恩
[ ^ ]
FileInfo类的功能受到限制.
我认为您使用IPropertySetStorage找到了正确的答案,尽管这仅适用于NTFS,如果将文件复制到fat32,它将丢失属性集.
see Ron in the comments section
http://www.online-tech-tips.com/computer-tips/how-to-change-the-last-modified-date-creation-date-and-last-accessed-date-for-files-and-folders/[^]
The FileInfo class is limited in what it can do.
I think you were onto the right answer with the IPropertySetStorage, though that only works for NTFS, if you copy the file to fat32 it will lose the property set.
这篇关于更改文件属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!