本文介绍了如何从本地驱动器显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! string ImageFile = itm.ProductImageURL.ToString(); // ImageFile vaue是C:\ Users \Public \Pictures \Sample Pictures\logo1.png //这是一个本地路径,我想显示本地驱动器中的图像,这个图像不在我正在运行的项目中。只有路径在数据库中。string ImageFile = itm.ProductImageURL.ToString();//ImageFile vaue is "C:\Users\Public\Pictures\Sample Pictures\logo1.png"//this is a local path , i want to show an image from local drive ,this image not in my running project. only path is in database.<a href="/ProductList/ProductDetails/@itm.Id"> <img src="@ImageFile " class="img-responsive" alt="Berry Lace Dress"></a>推荐答案<img src="@ImageFile " class="img-responsive" alt="Berry Lace Dress"></img> 在ASP.NET中,您通过在变量名称前添加前缀来使用服务器端变量在HTML标记中使用 @ 。 这篇关于如何从本地驱动器显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-27 13:29