コード例 #1
0
        GetImages(this IWebHostEnvironment hosting, string relativeDirPath)
        {
            var path  = hosting.GetFullPath(relativeDirPath);
            var names = Directory.GetFiles(path)
                        .Where(s => s.EndsWith(".svg") || s.EndsWith(".png"))
                        .Select(s =>
            {
                var fileName     = Path.GetFileName(s);
                var relativePath = Path.Combine(relativeDirPath, fileName);
                return(relativePath.AsHtmPath(), Path.GetFileNameWithoutExtension(fileName));
            });

            return(names);
        }
コード例 #2
0
 public static string GetImageInfo(this IWebHostEnvironment hosting, string relativePath)
 => hosting.GetFullPath(relativePath);