简体   繁体   English

使用 PropertyHandler Shell 扩展读写文件属性

[英]read write file properties with PropertyHandler Shell Extension

I'm trying to create PropertyHandler shell extension.我正在尝试创建PropertyHandler shell 扩展。 What's the best way for embedding properties like (Title,Author,.....) to use the same file in multi computers or devices?嵌入(标题,作者,.....)等属性以在多台计算机或设备中使用相同文件的最佳方法是什么? StgCreateStorageEx? way or there is other ways to do it?方式还是有其他方法可以做到这一点? because StgCreateStorageEx dealing with NTFS files only and i'm not sure if the file hold these properties with it if i open it in other device with same PropertyHandler因为StgCreateStorageEx仅处理NTFS文件,如果我在其他设备中使用相同的PropertyHandler打开它,我不确定该文件是否包含这些属性

Is there any way to save properties inside the my file?有没有办法在我的文件中保存属性?

The StgCreateStorageEx function creates a new storage object using the IStorage interface. StgCreateStorageEx function 使用 IStorage 接口创建一个新的存储 object。 This allows storing multiple data objects within a single binary file, see for example https://en.wikipedia.org/wiki/COM_Structured_Storage .这允许在单个二进制文件中存储多个数据对象,例如https://en.wikipedia.org/wiki/COM_Structured_Storage So, technically, you can save almost anything in this file including embedded properties.因此,从技术上讲,您可以在此文件中保存几乎所有内容,包括嵌入式属性。

I don't think that this is limited to NTFS: The old Microsoft Office.doc format (and many other Microsoft products) use this storage format and work also with FAT32.我不认为这仅限于 NTFS:旧的 Microsoft Office.doc 格式(以及许多其他 Microsoft 产品)使用这种存储格式并且也适用于 FAT32。

If you want to use this binary file format is a completely different question.如果要使用这种二进制文件格式是完全不同的问题。 As you did not provide any information about the content and format of your file, I cannot recommend anything.由于您没有提供有关文件内容和格式的任何信息,因此我无法推荐任何内容。 One alternative would be to store the content of your file in an xml file.一种替代方法是将文件的内容存储在 xml 文件中。 Properties like Title and Author then could be added easily.然后可以轻松添加 Title 和 Author 等属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM