0

在本地调试时,我可以从 .mp4 视频中读取标题。

但是,在我将此应用程序部署到 IIS 后,Title 属性为空。

任何想法为什么会发生这种情况?

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
            }
        }
4

0 回答 0