MetaData in .txt and .doc

  • Thread starter Thread starter Ivo
  • Start date Start date
I

Ivo

Hi,
I need help with creating .txt and .doc files form c#. I know how to create
these files so that they contain the text I want, but besides that text, I
also need to write metadata (hope that the term is right) to these files.
That means that I have a string 'title', a string 'author' and a string
'date' that I need to "attach" to the file. Off course, these information
(title, author and date) should not be written "into the file", but to be
available for seeing when someone rightclicks on the file, and then goes to
summary tab. I apologize if this or a question very much like this has
already been asked. Unfortunatley, I don't have the time to browse through
the enitre group.
Thanks.
 
Ivo,
Regarding your comment about "not having enough time to browse", here's a
sample search on "Metadata doc":

http://msdn.microsoft.com/newsgroup...-DC48AB0DA5C9&dglist=&ptlist=&exp=&sloc=en-us

you can do the same with Google or Live.com.

I don't think it is possible to attach "metadata" to a text file. Word "doc"
files support the metadata you see when you right - click on a file in
Windows Explorer and choose the various tabs. You can find out how to add
this data programmatically by studying the Word API.
Peter
 
Peter Bromberg said:
Ivo,
Regarding your comment about "not having enough time to browse", here's a
sample search on "Metadata doc":

http://msdn.microsoft.com/newsgroup...-DC48AB0DA5C9&dglist=&ptlist=&exp=&sloc=en-us

you can do the same with Google or Live.com.

I don't think it is possible to attach "metadata" to a text file. Word
"doc"
files support the metadata you see when you right - click on a file in
Windows Explorer and choose the various tabs. You can find out how to add
this data programmatically by studying the Word API.
Peter

Ok, thanks alot.
 
I don't think it is possible to attach "metadata" to a text file.
Peter

There is something called an "Alternate Data Stream" which could be
used to do this, however it is an NTFS-specific feature and not widely
known.

http://www.bleepingcomputer.com/tutorials/tutorial25.html


"Though ADS was created for compatibility with the Mac world, it is
not solely used for that purpose. Many applications use ADS to store
attributes of a file in them. For example if you make a text document,
and right click and go into its properties you will see a summary
page. This summary information is attached to the file via ADS. I will
show you more on that later and applications to see this information.

In summary, think of ADS as hidden files that are attached to the
visible ones. The main reason they are so dangerous is that they are
not well known, are generally hidden to the user, and that there are
few security programs that can recognize them."
 
Hi,

Ivo said:
Hi,
I need help with creating .txt and .doc files form c#. I know how to
create these files so that they contain the text I want, but besides that
text, I also need to write metadata (hope that the term is right) to these
files. That means that I have a string 'title', a string 'author' and a
string 'date' that I need to "attach" to the file. Off course, these
information (title, author and date) should not be written "into the
file", but to be available for seeing when someone rightclicks on the
file, and then goes to summary tab. I apologize if this or a question very
much like this has already been asked. Unfortunatley, I don't have the
time to browse through the enitre group.
Thanks.

That is not supported in the framework, you will have to P/invoke it, google
the archives for "Alternate streams"
 
Ignacio Machin ( .NET/ C# MVP ) said:
Hi,



That is not supported in the framework, you will have to P/invoke it,
google the archives for "Alternate streams"

Will do so, thanks to you and Philip.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top