【发布时间】:2011-01-03 15:19:09
【问题描述】:
在我的 MVC 应用程序中,我有以下路径;
- /content/images/full
- /content/images/thumbs
如何在我的 c# 控制器中获取我的 thumbs 文件夹中所有文件的列表?
编辑
Server.MapPath 仍然是最好的方法吗?
我现在有这个DirectoryInfo di = new DirectoryInfo(Server.MapPath("/content/images/thumbs") );,但觉得这不是正确的方法。
MVC 中是否有对此的最佳实践,或者上述方法是否仍然正确?
【问题讨论】:
-
以上(
Server.MapPath)在我看来是正确和可以接受的。
标签: asp.net-mvc file