这是从项目内的文件夹中读取所有文件(图像)名称的完整路径的代码
@{ string[] imgfiles = Directory.GetFiles(@"D:\MVClearningProjects\Demo\Demo\Property_Data\Images\" + item.Property_ID, "*.*");}
此代码是将第一个图像加载到 cshtml 视图文件
<img src="@Url.Content(imgfiles[0])" alt="carousel bootstrap first" readonly style="width:200px; height:120px;" />
//not allowed local resources when I run this project usig ISS