更改文件属性 [英] Change File Property

查看:118
本文介绍了更改文件属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

有人可以帮我编程一个应用程序,它可以更改标准文件属性的值,尤其是关键字吗?

我试图建立一个使用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.

推荐答案

建议一个人通过PInvoke使用ZwCreateFile().听起来很先进.

http://www.itags.org/msdn/3741948/ [
One guy suggested using ZwCreateFile() via PInvoke. This sounds quite advanced.

http://www.itags.org/msdn/3741948/[^]

One other guy wrote a console app to change the date time

FileInfo [] fi = di.GetFiles("*.*", SearchOption.AllDirectories);

foreach (FileInfo file in fi)
{
file.CreationTime = dt;
file.LastAccessTime = dt;
file.LastWriteTime = dt;
} 



请参阅评论部分中的罗恩



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.


这篇关于更改文件属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆