我知道如何使用 fileupload 控件和 saveas 方法将图像保存到文件夹中。但我从图像控件中获取图像并将其保存到文件中,而不使用文件上传控件并将其保存在文件夹中。
最佳答案
string filepath = img1.ImageUrl;
using (WebClient client = new WebClient())
{
client.DownloadFile(filepath,Server.MapPath("~/Image/apple.jpg"));
}
关于c# - 如何在Asp.net文件夹中保存图像控制图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10696185/