Here's how to iterate over SystemProperties.System.... properties to get metadata for an music, image or video file (there are many other filetypes as well) using Microsoft Windows API Code Pack.
From MS SystemProperties.System documentation
https://docs.microsoft.com/en-us/uwp/api/windows.storage.systemproperties?view=winrt-18362 we get following metadata categories to interrogate.
From MS SystemProperties.System documentation
https://docs.microsoft.com/en-us/uwp/api/windows.storage.systemproperties?view=winrt-18362 we get following metadata categories to interrogate.
SystemProperties.System.
Console.WriteLine(""); Console.WriteLine("SystemProperties.System.Media - Media Category Properties"); Console.WriteLine(""); string mediaProp = string.Empty; PropertyInfo[] mediaPI = typeof(SystemProperties.System.Media).GetProperties(); foreach (PropertyInfo property in mediaPI) { //https://docs.microsoft.com/en-us/windows/win32/properties/props-system-photo-aperture !@@@@@@@ mediaProp = "System.Media." + property.Name; //@@@@@@@@@@@! This took tooo long to figure out! //NOT - mediaProp = "SystemProperties.System.Media" try { IShellProperty ishellprop = picture.Properties.GetProperty(mediaProp); //very slow if (ishellprop != null && ishellprop.ValueAsObject != null) Console.WriteLine(ishellprop.Name + "=" + ishellprop.ValueAsObject.ToString()); } catch { continue; } }
No comments:
Post a Comment