0

ローカルでデバッグすると、.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
            }
        }
4

0 に答える 0