See updated answer below.
(You can retrieve an existing property item and change the value.
See
Image.GetPropertyItem Method[
^]
There is a little example you can follow there.
This information can be useful for getting the ID number
Image Property Tag Constants[
^]
Also see this Stack Overflow question:
How to get and set propertyitems for an image[
^])
[UPDATE]
First. The Image.Tag property has nothing to do with the detailed properties. It is usually used to carry extra information about an object inside the code. It is not saved to the file.
I lead you astray as I didn't read your question properly. After some research I have found out the following.
To read the detailed information this article will be useful.
Retrieve detailed information of a File[
^]
Note! Using the demo code directly will not work under Windows 8 or later.
You have to modify how to get the folder information.
In the the file
CfileInfo.cs you need to change the following lines
in the method
GetDetailedFileInfo
.
ShellClass sh = new ShellClass();
Folder dir = sh.NameSpace(Path.GetDirectoryName(sFile));
to
Folder dir = GetShell32Folder(Path.GetDirectoryName(sFile));
You also need to add the method
GetShell32Folder
private Shell32.Folder GetShell32Folder(string folderPath)
{
Type shellAppType = Type.GetTypeFromProgID("Shell.Application");
Object shell = Activator.CreateInstance(shellAppType);
return (Shell32.Folder)shellAppType.InvokeMember("NameSpace",
System.Reflection.BindingFlags.InvokeMethod, null, shell, new object[] { folderPath });
}
It's a workaround I found here:
Instantiate Shell32.Shell object in Windows 8[
^]
The property Tags is not included, so you need to add a case in the switch clause in the
CFileInfo
constructor. I think it should be case 13, but I am not sure because I have no file to test on.
In
CFileInfo
all the detailed properties are read only, so you need to add set functionality yourself.
I don't have more time to work on this question at the moment, but if I can I will update my answer. Just don't hold your breath.