要将图像存储在本地驱动器上 [英] To store image on local drive temporary

查看:52
本文介绍了要将图像存储在本地驱动器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我的应用程序中有一个html表.在该表中,我只有一个表行.
在该表行中,我有2个

标签.在一个
中,我有一个带位图的图像,在第二个
我正在使用一张MS图表控件来处理一幅图像.现在我想将这两幅图像都存储在特定位置.但是我想在那里合并视图,即彼此相邻view.ie.如表行所示那么我该如何实现呢?????

Hello all,
I having one html table in my application.In that table I having one table row.
In that table row i am having 2

tags.In one
i am having one image with bitmap and in second
i am having one image with MS chart control.Now i want to store both the images on specific location.But i want there combined view i.e near by each other view.ie.as shown in Table row.So how can i achieve that?????

推荐答案

为此,您必须将图像存储在解决方案中,而且还必须将字符串路径存储在数据库中. ..
如果您在asp.net中工作,请使用两个不同的Image控件,并将其一个名为ImageUrl的属性与数据库表绑定...
使用带有border:none的CSS样式表;图像控件,并在页面加载中将数据对象交给数据控件,现在您可以并排看到两个图像,而不必用边框分开...
您必须使用文件上载控件来上载文件,此控件具有一个名为Save()的方法,使用此方法时必须使用该方法来上载文件,必须使用MapPath在括号中传递路径()功能.....

FileUploadControl.Save(MapPath(yourFolderWithinSolution));


只需在保存方法中提供完整的静态路径,例如...

FileUploadControl.Save("c:\\ myfile.jpg");
For that you have to store images in your solution and also you''ve to store string path in database...
if you are working in asp.net, take two difference Image control and bind its one property named ImageUrl with the database table...
apply css style sheet with border:none; to the image control and give the data object to your data control in page load now you can see the both images side by side without separated by border...
You have to upload file with the use of File Upload Control, this control has one method named Save(), this method you have to use to upload file when you are using this method you have to pass path in parentheses with the use of MapPath() function... like..

FileUploadControl.Save(MapPath(yourFolderWithinSolution));

or
just give full static path in save method like...

FileUploadControl.Save("c:\\myfile.jpg");


您需要为此使用特殊的文件夹.

通常,您需要使用路径Environment.GetFolderPath(System.Environment.SpecialFolder. LocalApplicationData).
有关其他选项,请参见枚举System.Environment.SpecialFolder.

参考文献:
http://msdn.microsoft.com/en-us/library/14tx8hby.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system.environment. specialfolder.aspx [ ^ ].

—SA
You need to use a special folder for that.

Most typically, you need to use the path Environment.GetFolderPath(System.Environment.SpecialFolder. LocalApplicationData).
See the enumeration System.Environment.SpecialFolder for other options.

References:
http://msdn.microsoft.com/en-us/library/14tx8hby.aspx[^],
http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx[^].

—SA


这篇关于要将图像存储在本地驱动器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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