编辑文件元数据 [英] Editing file Metadata

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

问题描述

在互联网上搜索时,我发现了一个关于阅读和编辑图像文件中包含的元数据的链接。



我读了链接并想到了自己; 如果PNG类型的图像文件包含诸如名称,大小,项目类型,创建日期等信息。其他文件类型中存储了哪些类型的信息?


为了回答上述问题,我在互联网上徘徊了一些,并使用各种示例,我使用Microsoft Shell和Automation参考创建了一个简单的Windows应用程序,以显示包含在EXE,DLL,DOCX和VBPROJ等文件格式中的元数据仅举几例。



在查看我的一个Word文档中包含的元数据时,我注意到作者标签包含我不再使用的电子邮件地址。然后我开始怀疑,我可以编辑不正确的元数据项吗?不幸的是,Shell32.dll不允许这样做。



所以我的问题是:由于元数据是由各种应用程序编写的:什么命名空间或者它可能是什么在我的应用程序中使用以编辑存储在元数据中的特定标签?



谢谢,

MRM

While searching the Internet I came across a link about reading and editing metadata contained in image files.

I read the link and thought to myself; "If the an image file of type PNG contained such information as Name, Size, Item Type, Date Created and so forth. What type of information is stored in the other file types?"

To answer the aforementioned question I prowled around the Internet some more and using various examples I created a simple Windows application using the Microsoft Shell and Automation reference to display the metadata contained in file formats like EXE, DLL, DOCX and VBPROJ just to name a few.

While looking at the metadata contained in one of my Word documents I noticed the "Author" tag contained an email address I no longer use. Then I started to wonder, "Can I edit the incorrect metadata item?" Unfortunately, the Shell32.dll does not allow this.

So my question is: Since metadata is written by various applications: What namespace or whatever-it-may-be do I use in my application to edit specific tags stored in the metadata?

Thanks,
MRM

推荐答案

奇怪的问题。看起来,由于某种原因,你确信世界上的所有东西(或者至少每一种广泛使用的媒体格式)都有一些名称空间(好像命名空间是某些库),或者以一种或另一种方式暴露给您使用的API,例如.NET FCL。事实并非如此,并非如此。有时您需要获取一些标准(它甚至可以公开获得),阅读它并实现语义上读/写的方式。或者找一些第三方库。



当文件格式间接可访问时(例如,你可以查看以这种格式保存图像并保存图像)但无法详细访问格式细节。这是可以解释的。将它全部暴露出来甚至需要暴露出图书馆未触及的细节。这样做会极大地破坏库代码,并且会使API更加膨胀。如果不是更少的话,这个膨胀将用于节省约0.1%的用户。没有这样的事情真的会分开。比方说,PE文件(DLL和EXE)是由编译器直接编写的,也是通过CodeDOM编写的(也使用编译器),但有多少变态器需要直接挖掘到PE的内部结构?



同时,有许多格式可供使用。这很有趣,但我可以找到你在问题中列出的所有格式。看点:



Strange question. It looks like, by some reason, you are convinced that everything in the world (or at least every single widely used media format) has some "namespace" (as if namespaces were some libraries), or in one or another way is exposed to the API you use, such as .NET FCL. This is not so and wasn't meant to be so. Sometimes you need just grab some standard (it it is even publicly available), read it and implement how semantically read/write it. Or find some 3rd-party library.

And this case is way much more typical then the opposite, when the file format is indirectly accessible (say, you can view an image and save your image in this format) but detailed access to the detail of format is not available. This is quite explainable. Exposing it all would require exposing even the detail which remains untouched by the library. Doing it would enormously bloat the library code, and, it would bloat the API even more. And this bloat would be done for the save of some 0.1% of the users, if not less. No such things would really be separate. Say, PE files (DLL and EXE) are written by compilers directly and through CodeDOM (which also uses compilers), but how many perverts would want to dig directly into the internal structure of PE?

At the same time, many formats are available. It's funny, but I can find out the all the formats you listed in your question. What to see:

  1. PE文件(EXE,DLL等):

    http://en.wikipedia.org/wiki/Portable_Executable [ ^ ]。



    这里描述:

    http://msdn.microsoft.com/en-us/windows/hardware/ gg463119.aspx [ ^ ],

    http://msdn.microsoft.com/en- us / magazine / cc301805.aspx [ ^ ],

    http://msdn.microsoft.com/ en-us / magazine / cc301808.aspx [ ^ ]。
  2. DOCX :

    这是OpenXML标准的一部分,标准化为ECMA-376和ISO / IEC 29500:

    http://en.wikipedia.org/wiki/Open_XML [ ^ ]。



    ECMA标准一如既往地公开发布:http://www.ecma-international.org/publications/standards/Ecma-376.htm [ ^ ]
  3. VBPROJ

    MSBuild标准的一部分符合相应的XML模式并进行了全面描述:

    http://msdn.microsoft.com/en-us/libr ary / 5dy88c2e.aspx [ ^ ]。



    参见:

    http://msdn.microsoft.com/en-us/library/dd393574.aspx [ ^ ],

    http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx [ ^ ]。
  1. PE files (EXE, DLL and more):
    http://en.wikipedia.org/wiki/Portable_Executable[^].

    Described here:
    http://msdn.microsoft.com/en-us/windows/hardware/gg463119.aspx[^],
    http://msdn.microsoft.com/en-us/magazine/cc301805.aspx[^],
    http://msdn.microsoft.com/en-us/magazine/cc301808.aspx[^].
  2. DOCX:
    This is a part of OpenXML standard, standardized as ECMA-376 and ISO/IEC 29500:
    http://en.wikipedia.org/wiki/Open_XML[^].

    ECMA standard, as always, is publicly available: http://www.ecma-international.org/publications/standards/Ecma-376.htm[^]
  3. VBPROJ:
    The part of MSBuild standard which conforms to the appropriate XML schema and comprehensively described:
    http://msdn.microsoft.com/en-us/library/5dy88c2e.aspx[^].

    See also:
    http://msdn.microsoft.com/en-us/library/dd393574.aspx[^],
    http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx[^].





享受,

-SA


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

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