0 c# asp.net-mvc asp.net-mvc-routing
我需要在文件夹路径中获取图像是否存在.我使用以下代码:
bool isExists = System.IO.Directory.Exists(Server.MapPath(FolderPath + "Logo.png"));
Run Code Online (Sandbox Code Playgroud)
但是如果文件存在,bool变量返回false.
也许你应该使用File.Exists.
bool isExists = System.IO.File.Exists(Server.MapPath(FolderPath + "Logo.png"));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
389 次 |
| 最近记录: |