且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从图像文件夹中将图像提取到aspx页面

更新时间:2023-10-10 17:03:16

参考



1. 如何将图像保存到数据库中的文件夹和图像路径,并使用asp.net基于数据库中的图像路径显示gridview中文件夹中的图像 [ ^ ]

2. 从文件夹中检索所有图像并使用DataList控件显示它们[ ^ ]


这实际上取决于你想要做什么。你想要一个对所有用户都相同的静态图像,然后你可以设置一个IMAGE标签:

< asp:Image ID =Image1runat =serverImageUrl =Resources /Images/Problems/UnderConstruction01.png/>

如果你想要一个依赖于用户的图像(也许是一个化身),那么你需要做一些更复杂的事情: ASP.NET的通用Image-From-DB类 [ ^ ] - 使用数据库,但是文件相同,只是更简单。
That really depends on exactly what you want to do. It you want a static image that is the same for all users, then you could just set an IMAGE tag:
<asp:Image ID="Image1" runat="server" ImageUrl="Resources/Images/Problems/UnderConstruction01.png" />
If you want an image that depends on the user (an avatar perhaps) then you need to do somethign a little more complex: A generic Image-From-DB class for ASP.NET[^] - that uses a DB, but from a file is the same, just a little simpler.