在本地调试时,我可以从.mp4视频中读取标题。
但是,在将此应用程序部署到IIS后,Title属性为null。
为什么会发生这种情况?
foreach (var f in new DirectoryInfo(videosLocation).GetFiles()
.Where(x => x.FullName.EndsWith(".mp4", StringComparison.CurrentCultureIgnoreCase))
.ToList())
{
using (var so = ShellObject.FromParsingName(f.FullName))
{
var titleProp = so.Properties.GetProperty(SystemProperties.System.Title).ValueAsObject;
var title = titleProp == null ? "no title" : titleProp.ToString();
// title is null when deployed
}
}