I know that each file has metadata like title, subject, keywords and comments:
But what if I need custom metadata like tags for example?
Is it possible to do it with C#?
I know that each file has metadata like title, subject, keywords and comments:
But what if I need custom metadata like tags for example?
Is it possible to do it with C#?
I know that each file has metadata like title, subject, keywords and comments
That is not true. Most file types do not have a 'standard' form of metadata.
In particular, PDF files don't have properties that Windows Explorer recognizes.
Metadata (file attributes) is not a function of the filesystem.
If using NTFS you can store whatever you like in an Alternate data stream
As per Jesper's comment, you can use the DSOFile library to read and write to Custom properties that are stored in ADS.
Works well for me though note the fact that the properties are lost when file is transferred to a different file system, including email.
see http://www.keysolutions.com/blogs/kenyee.nsf/d6plinks/KKYE-79KRU6 for a 64bit implementation, link to MS original and comments.
This will depend on whether the file type you are working with supports this. For example this will not be possible with a text file.
Has anyone thought of using the File ID for this? You can get it via the command
fsutil file queryfileid "C:/my/path/example.txt"
This could be used to store information about this file in a separate storage-file associated with the id.
File ID is 0x0000000000000000003200000007963e
- how does that solve the question about metadata? Could you give an example how you would leverage it? –
Juback fsutil file queryfileid
that we can use directly in C# rather than having to execute fsutil.exe ? –
Juback © 2022 - 2024 — McMap. All rights reserved.