Delphi:如何设置(写)扩展文件属性? [英] Delphi: How to SET(write) extended file properties?

查看:163
本文介绍了Delphi:如何设置(写)扩展文件属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置属性,如Windows资源管理器文件属性 - >摘要选项卡(作者,标题,主题等)所示。 (在Windows 7是详细信息选项卡)
我已经知道如何使用找到集合属性Delphi代码。
或如果您有最新的JCL库 - 请使用TJclFilePropertySet jclNtfs.pas
警告:请注意,此代码适用于xls文件,但在Windows中的txt / cvs和jpg文件似乎不起作用7 Pro / Enterprise或2008(64位)。
似乎M $已经改变了属性在这些操作系统中的工作方式:您不能添加或更改某些类型的文件的文件属性,例如,您不能将任何属性添加到TXT或RTF文件。不幸的是,回到XP模式不是一个选择。


I would like to set properties as shown in Windows Explorer File Properties->Summary Tab (Authors, Title, Subject, etc). (In Windows 7 is the Details tab) I already know how to GET them using StgCreateStorageEx,

The target file extensions are xls, xlsx, csv, txt and jpg files. OS: Windows 2003/2008/XP/Windows 7. Notice that this code will go a web service application and the server does not have Excel installed.

Note:It seems to be that there is no information/sample code about how to SET them.

解决方案

Partial answer: The set property Delphi code can be found here. or if you have the latest JCL library - use TJclFilePropertySet at jclNtfs.pas Warning: Notice that this code works for xls files but it does not seem to work for txt/cvs and jpg files in Windows 7 Pro/Enterprise or 2008 (64 bits). It seems that M$ has changed the way properties work in these OS: "You can't add or change the file properties of some types of files. For example, you can't add any properties to TXT or RTF file". Sadly for me, going back to XP mode is not an option.

这篇关于Delphi:如何设置(写)扩展文件属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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