创建文件时的自定义文件属性 [英] Custom file attributes when creating a file

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

问题描述





我正在使用文件流/二进制编写器创建自己的自定义文件,我希望将自定义详细信息属性写入文件(类似于当你右键点击> MP3上的属性时,你会看到你去详细信息的时间。



我要添加的属性是Duration(DateTime)和Counter(int32)。



如何我这样做吗? (有可能吗?)



谢谢!

Hi,

I am creating my own custom file using a filestream/binary writer and I am looking to write custom details attributes to the file (similar to what you'd see when you go to Details when right click> properties on an MP3).

The properties I want to add are Duration (DateTime) and Counter (int32).

How do I do this? (Is it possible?)

Thanks!

推荐答案

你好,



MP3文件格式使用 ID3元数据 [ ^ ]。它允许标题,艺术家,专辑,曲目编号和有关文件的其他信息等信息存储在文件本身中。 Windows操作系统已经支持这种文件格式和必要的代码来检索ID3元数据。这就是您在右键单击文件并选择属性时能够看到此信息的原因。



对于能够从文件中检索此类标记的窗口,您需要让窗口知道它,并且通常通过shell扩展来完成。请参阅以下CP文章,它们将帮助您入门

Hello,

MP3 file format uses ID3 metadata[^]. It allows information such as the title, artist, album, track number, and other information about the file to be stored in the file itself. The windows OS already has support for this file format and necessary code to retrieve the ID3 metadata. That's the reason you are able to see this information when you right click the file and select properties.

For windows to be able to retrieve such tags from your file you need to make windows aware of it and it's typically done via a shell extension. See following CP articles which will get you started

  • .NET Shell Extensions - Shell Context Menus[^]
  • The Complete Idiot's Guide to Writing Shell Extensions - Index[^]
  • .NET Shell Extensions - Shell Property Sheets[^]
  • .NET Shell Extensions - Shell Info Tip Handlers[^]


这是关于此的链接: http://blog.rodhowarth.com/2008 /06/how-to-set-custom-attributes-file.html [ ^ ]
Here is a link about that : http://blog.rodhowarth.com/2008/06/how-to-set-custom-attributes-file.html[^]


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

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