每当我试图将图像保存在指定的字符串路径中时,我都会不断收到 GDI+ 错误。这是代码:你能告诉我吗?
System.Drawing.Image newImage;
byte[] b= (byte[])Session["Image"];
using (MemoryStream stream = new MemoryStream(b))
{
newImage = System.Drawing.Image.FromStream(stream);
newImage.Save("C:\\test.png"); //this is where the GDI+ error is thrown
Image1.Attributes.Add("src", "C:\\test");
}