在我的MVC应用程序中,我有以下路径;
> / content / images / full
> / content / images / thumbs
编辑
Server.MapPath还是最好的办法吗?
我现在有DirectoryInfo di = new DirectoryInfo(Server.MapPath(“/ content / images / thumbs”));但觉得这不是正确的方法.
在MVC中是否有最佳做法或以上是否正确?
解决方法@H_404_17@
Directory.GetFiles("/content/images/thumbs")
这将使目录中的所有文件都成为一个字符串数组.
Directory.GetFiles("/content/images/thumbs")
这将使目录中的所有文件都成为一个字符串数组.