C# 获得;“媒体创建”;UWP中视频文件的日期

C# 获得;“媒体创建”;UWP中视频文件的日期,c#,.net,uwp,windows-10-universal,C#,.net,Uwp,Windows 10 Universal,我想获取视频文件的创建日期,通常称为媒体创建的属性(不要与文件创建日期混淆) 我正在尝试使用以下代码: var clip = await MediaClip.CreateFromFileAsync(x); var encodingProps = clip.GetVideoEncodingProperties(); var props = encodingProps.Properties.ToList(); 在props引用中,我得到了一个guid和值的列表,但是我在那里丢失了。您可以使用它来获

我想获取视频文件的创建日期,通常称为媒体创建的属性(不要与文件创建日期混淆)

我正在尝试使用以下代码:

var clip = await MediaClip.CreateFromFileAsync(x);
var encodingProps = clip.GetVideoEncodingProperties();
var props = encodingProps.Properties.ToList();
props
引用中,我得到了一个guid和值的列表,但是我在那里丢失了。

您可以使用它来获得所需的特定属性:

var dateEncodedPropertyName = "System.Media.DateEncoded";
var propertyNames = new List<string>()
{
    dateEncodedPropertyName
};

// Get extended properties
IDictionary<string, object> extraProperties =
    await file.Properties.RetrievePropertiesAsync(propertyNames);

// Get the property value
var propValue = extraProperties[dateEncodedPropertyName];
if (propValue != null)
{
    Debug.WriteLine(propValue);
}
var dateEncodedPropertyName=“System.Media.DateEncoded”;
var propertyNames=新列表()
{
dateEncodedPropertyName
};
//获取扩展属性
索引外属性=
等待file.Properties.RetrievePropertiesAsync(propertyNames);
//获取属性值
var propValue=extraProperties[dateEncodedPropertyName];
if(propValue!=null)
{
Debug.WriteLine(propValue);
}
注意:我在示例中使用了。如果需要其他属性,请在中查看支持的属性的完整列表及其确切名称