我如何保存图像? [英] HOW CAN I SAVE IMAGE?

查看:65
本文介绍了我如何保存图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在断开连接的环境中保存图像?
我想做的是在断开连接的数据表/gridview中添加图像...之后,我想将所有数据保存在SQL数据库中.例如我输入了5张照片,它们有差异行,在断开连接的环境中,将它们添加到datatable/gridview后,每行将保存到SQL中.

Is that possible to save image in a disconnected environment?
I want to do is to Add image in a disconnected datatable/gridview... and after that I want to save all the data in the SQL database. e.g. I inputed 5 photos, they have diff rows, in a disconnected environment, after adding that into the datatable/gridview, every row will save into the SQL.

推荐答案

if您要在解决方案中保存图像,那么这非常简单.假设您有一个fileupload控件来上传图像,那么您可以编写如下代码块...

if you want to save image in your solution then it is very simple. suppose you have a fileupload control to upload a image then you can write a block of code like this...

fileUpload1.PostedFile.Save(string path);//give the path at where you want to save image...
// or you can use MapPath() static method of Server class, like....
fileUpload1.PostedFile.Save(Server.MapPath("Image")+"/fileName.jpg");//MapPath() method will map your solution path automatically, you have to pass the folderName as a parameter, here i give Image folder name as a string...




我想您想保存图像而不使用数据库
.将其保存在目录中非常简单.但是如果要检索该图像,则应该知道图像的名称.


i think u want to save a image without using database
. it so simple to save it in a directory. but if you want to retrieve that image u should have to know the name of the image.


这篇关于我如何保存图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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