使用c#在asp.net的根文件夹外部显示图像 [英] Display image from outside the root folder in asp.net using c#
本文介绍了使用c#在asp.net的根文件夹外部显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有我的网站C:\inetpub \ www.root \website。在我的网站上,我使用c#将图像上传到c:\inetpub \wwwroot \ Uploadimages \。我已成功上传此文件夹中的图像。但我无法通过此路径获取图像以在网站中显示图像。如何从根文件夹外部显示图像。请任何人帮助我。?
i have my website C:\inetpub\wwwroot\website. in my website i upload the image using c# to c:\inetpub\wwwroot\Uploadimages\. i have successfully upload image in this folder. but i could not get image from this path to display image in website. how to display image from outside the root folder. please any one help me with that.?
推荐答案
<form id="form1" runat="server">
<asp:image id="Image1" runat="server" imageurl="~/Uploadimages/imag.jpg" />
<%--'~' it's denoting the root path--%>
</form>
这篇关于使用c#在asp.net的根文件夹外部显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文