我正在尝试使用文件中的位置显示图像。目前我将图像存储在我的Web应用程序的内容文件夹中,但我不知道如何在那里访问它或在页面本身上显示它。这就是我现在所拥有的。
Image image = Image.FromFile(@"~\Content\img\toendra.JPG");
答案 0 :(得分:0)
在Web窗体中,我们使用Image control来显示图像。把它放在你的标记中:
<asp:Image runat="server" ImageUrl="~/Content/img/toendra.JPG" />