how can i retreive an image in asp.net called "dddd" from a file system and show it on the web page?
我如何从文件系统中检索名为“dddd”的asp.net中的图像并在网页上显示?
3 个解决方案
#1
2
Try
<asp:Image id="Image1" runat="server"
ImageUrl="dddd.png"/>
#2
2
If the file is located in your web app, then just use the ImageUrl property. @Bala R provided a good example.
如果该文件位于您的Web应用程序中,则只需使用ImageUrl属性。 @Bala R提供了一个很好的例子。
If the file is located outside of the path of your web app then you will need to create a virtual directory that points to that location.
如果文件位于Web应用程序路径之外,则需要创建指向该位置的虚拟目录。
If you are talking about a file that is on the clients computer, then you can't do this at all.
如果您正在谈论客户端计算机上的文件,那么您根本无法执行此操作。
#3
1
Try
<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/dddd.png" />
~/ImageLocationFolder/Image
Regards
#1
2
Try
<asp:Image id="Image1" runat="server"
ImageUrl="dddd.png"/>
#2
2
If the file is located in your web app, then just use the ImageUrl property. @Bala R provided a good example.
如果该文件位于您的Web应用程序中,则只需使用ImageUrl属性。 @Bala R提供了一个很好的例子。
If the file is located outside of the path of your web app then you will need to create a virtual directory that points to that location.
如果文件位于Web应用程序路径之外,则需要创建指向该位置的虚拟目录。
If you are talking about a file that is on the clients computer, then you can't do this at all.
如果您正在谈论客户端计算机上的文件,那么您根本无法执行此操作。
#3
1
Try
<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/dddd.png" />
~/ImageLocationFolder/Image
Regards