迭代通过站点相对路径查找文件(ASP.NET MVC 3)

我的Web应用程序(ASP.NET MVC 3)中有一个文件夹,其中包含一组图像。 我想使用foreach循环迭代文件夹以获取站点相对路径,然后我可以将其附加到图像标记。

@foreach(string file in ?????) { filename without extension }

我该怎么做呢?

注意:我当前的foreach循环试图查看物理路径并返回此错误

 Could not find a part of the path 'C:\Content\Images\Photography\Slides\'. 

假设您想要枚举相对于网站根目录的路径中的文件,您可以这样做:

 @foreach (var file in Directory.GetFiles(Server.MapPath("~/Content/Images/Photography/Slides")))