如何将图像控制图像保存在Asp.net中的文件夹中 [英] How to save Image Control Image in Folder in Asp.net

查看:64
本文介绍了如何将图像控制图像保存在Asp.net中的文件夹中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用带有saveas方法的fileupload控件将图像保存到文件夹.但是我要从图像控件中获取图像并将其保存到文件中,而无需使用fileupload控件-将其保存在文件夹中.

I know how to save an image to a folder using the fileupload control with the saveas method. But I to take an image from the image control and save it to a file without using the fileupload control n save it in folder.

推荐答案

string filepath = img1.ImageUrl;           
using (WebClient client = new WebClient())
{
       client.DownloadFile(filepath,Server.MapPath("~/Image/apple.jpg"));
}

这篇关于如何将图像控制图像保存在Asp.net中的文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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