为什么这样做:
System.Drawing.Image imageBmp =
System.Drawing.Image.FromFile(Server.MapPath("~/Images/Image.jpg"));
imageBmp.Save(Server.MapPath("~/Images2/Image.jpg"),
System.Drawing.Imaging.ImageFormat.Bmp);
Bitmap bmp = new Bitmap(imageBmp);
这不是吗? (文件名正确)
var fileName = Request.QueryString["name"];
System.Drawing.Image imageBmp =
System.Drawing.Image.FromFile(Server.MapPath("~/Images/" + fileName));
imageBmp.Save(Server.MapPath("~/Images/" + fileName),
System.Drawing.Imaging.ImageFormat.Bmp);
Bitmap bmp = new Bitmap(imageBmp);
答案 0 :(得分:1)
此行会尝试将文件保存到自身imageBmp.Save(Server.MapPath("~/Images/" + fileName),
System.Drawing.Imaging.ImageFormat.Bmp);
应为imageBmp.Save(Server.MapPath("~/Images2/" + fileName),
System.Drawing.Imaging.ImageFormat.Bmp);