vs2003上传图片出错。报“GDI+ 中发生一般性错误。”在线等 30
privatevoidButton1_Click(objectsender,System.EventArgse){SaveImg(this.File1,@"\upload...
private void Button1_Click(object sender, System.EventArgs e)
{
SaveImg(this.File1,@"\uploadimg\arImg\");
}
public string SaveImg(System.Web.UI.HtmlControls.HtmlInputFile file,string path)
{
string namestr = ".jpg";
namestr = DateTime.Now.Year.ToString()+DateTime.Now.Month.ToString()+DateTime.Now.Day.ToString()+DateTime.Now.Hour.ToString()+DateTime.Now.Minute.ToString()+DateTime.Now.Second.ToString()+DateTime.Now.Millisecond.ToString()+namestr;
System.Drawing.Image image,aNewImage;
image=System.Drawing.Image.FromStream(file.PostedFile.InputStream);
Bitmap output1 = new Bitmap(image);
string aa = path + namestr;
Response.Write(aa);
output1.Save(aa,System.Drawing.Imaging.ImageFormat.Jpeg);
return namestr;
}
上面是代码片段,谁帮测一下是什么问题呀! 展开
{
SaveImg(this.File1,@"\uploadimg\arImg\");
}
public string SaveImg(System.Web.UI.HtmlControls.HtmlInputFile file,string path)
{
string namestr = ".jpg";
namestr = DateTime.Now.Year.ToString()+DateTime.Now.Month.ToString()+DateTime.Now.Day.ToString()+DateTime.Now.Hour.ToString()+DateTime.Now.Minute.ToString()+DateTime.Now.Second.ToString()+DateTime.Now.Millisecond.ToString()+namestr;
System.Drawing.Image image,aNewImage;
image=System.Drawing.Image.FromStream(file.PostedFile.InputStream);
Bitmap output1 = new Bitmap(image);
string aa = path + namestr;
Response.Write(aa);
output1.Save(aa,System.Drawing.Imaging.ImageFormat.Jpeg);
return namestr;
}
上面是代码片段,谁帮测一下是什么问题呀! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询