If you are trying to access these properties:
You can do the following:
- Add a reference to C:\Windows\System32\Shell32.dll. VS 2022 automatically creates an interop to interact with the ActiveX library.
- I added the following code to a button click event to demonstrate getting the data desired.
Code Sample:
Shell32.Shell shell = new Shell32.Shell();
Shell32.Shell objShell = shell.Application;
Shell32.Folder folder = objShell.NameSpace(@"D:\TestFolder");
Shell32.FolderItem folderItem = folder.ParseName("TestMetadata.jpg");
for (int tagIndex = 0; tagIndex < 321; tagIndex++)
{
// Pass null in the first parameter to get the tagName
string tagName = folder.GetDetailsOf(null, tagIndex);
if (!string.IsNullOrEmpty(tagName))
{
// Pass an instance of Shell32.FolderItem to get the tag value.
string tagValue = folder.GetDetailsOf(folderItem, tagIndex);
Console.WriteLine($"[{tagIndex}] {tagName} = {tagValue}");
}
}
The console will display strings representing the values of interest. I'm not sure why, by dates containing single digit month and/or day values will display a ? for the 0 digit. These can easily be replaced and then the date can be parsed. Here is the output for some of the interesting ones displayed in the Properties\Details tab:
[3] Date modified = 9/3/2022 2:37 PM
[4] Date created = 9/3/2022 2:35 PM
[5] Date accessed = 9/3/2022 10:38 PM
[12] Date taken = ?1/?1/?2022 ??2:36 PM
[18] Tags = Metadata Tags
[21] Title = My Test Title
[22] Subject = Being and Nothingness
[24] Comments = Kilroy wuz here!
[25] Copyright = 2022
[136] Date acquired = ?1/?2/?2022 ??2:36 PM
As far as I am aware, there are as many as 320 different tag types.