从保存的位置显示图片 [英] Display picture from saved location

查看:70
本文介绍了从保存的位置显示图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net中有用于上传图片并保存在某个位置的代码.我想要一个可以加载保存的图片和一些数据(例如名称,地址,城市,国家等)的代码,在您单击页面上的(打印或查看)按钮后,它将显示(预览)页面或显示所有这些数据的表格(即一侧的图片,下面的另一数据)

[edit]主题移至问题主体,标记-OriginalGriff [/edit]

i have code in asp.net for uploading a picture and saving in a location. I want a code that will load the saved picture and some data (e.g Name, Address, City, Country etc ), after you click on (a Print or a View) button on your page, it will display(Preview) a page or a form showing all this data(i.e. the picture on one side,and the other data below)

[edit]Subject moved into question body, tags - OriginalGriff[/edit]

推荐答案

单击按钮,首先使用...将图像保存在您的网站文件夹中. ..
On button click, first save image in your website folder using.......
string name="I001"; //Write code to increment image id
string extension=Path.GetExtension(FileUpload1.PostedFile.FileName);
FileUpload1.SaveAs(Server.MapPath(".\\Images\\")+name+extension);


然后,
写代码


then,
write code

//Image1 is ASP Image control
Image1.ImageUrl=Server.MapPath(".\\Images\\")+name+extension;


如果您只想显示图片和信息,则可以使用报表查看器.

您可以将参数传递到报告中.因此,图像的文件路径将是一个.然后,将一个图像对象从工具箱放置到报表上,并在属性中告诉它使用参数作为图像的位置.

您的数据存储在数据库中吗?如果是这样,您可以查询数据库以获取该数据库并将其设置为报表的数据源.

无论哪种方式,您都可能想签出SQL Server Reporting Services和报表查看器.
If your looking to just display the picture and information you could use a report viewer.

You can pass parameters into the report. So the file path to the image would be one. Then you place an image object from the tool box onto the report and in the properties tell it to use the parameter as the location of the image.

Is your data stored in a database? If so you can query the database to get it out and set it as the datasource for the report.

Either way you might want to check out SQL Server Reporting Services and the Report Viewer.


Uploading Image to a Folder and Display the Image after Upload

If i misunderstand your question, please feel free to correct me.
I hope the above information will be helpful. If you have more concerns, please let me know.


这篇关于从保存的位置显示图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆