01.
using
Microsoft.WindowsAPICodePack.Shell;
02.
using
Microsoft.WindowsAPICodePack.Shell.PropertySystem;
03.
04.
using
(ShellPropertyCollection properties =
new
ShellPropertyCollection(filePath))
05.
{
06.
foreach
(IShellProperty prop
in
properties)
07.
{
08.
string
value = (prop.ValueAsObject ==
null
) ?
""
: prop.FormatForDisplay(PropertyDescriptionFormatOptions.None);
09.
Console.WriteLine(
"{0} = {1}"
, prop.CanonicalName, value);
10.
}
11.
}
12.
13.
using
(ShellObject shell = ShellObject.FromParsingName(filePath))
14.
{
15.
16.
IShellProperty prop = shell.Properties.System.Media.Duration;
17.
18.
string
duration = prop.FormatForDisplay(PropertyDescriptionFormatOptions.None);
19.
}