求助:异常详细信息: System.Runtime.InteropServices.ExternalException: GDI+ 中发生一般性错误。

[复制链接]
查看11 | 回复2 | 2009-4-15 20:19:16 | 显示全部楼层 |阅读模式
GDI+ 中发生一般性错误。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Runtime.InteropServices.ExternalException: GDI+ 中发生一般性错误。
源错误:
执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[ExternalException (0x80004005): GDI+ 中发生一般性错误。]
System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) +378938
System.Drawing.Image.Save(String filename, ImageFormat format) +69
NewsCenter_BasicControl_PicNews.BindData() +502
NewsCenter_BasicControl_PicNews.Page_Load(Object sender, EventArgs e) +248
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.42; ASP.NET 版本:2.0.50727.42
请问如何解决?
这个错误是偶尔出现,例如按住f5,快速刷新就会出现这个错误。请各位高手指点

回复

使用道具 举报

千问 | 2009-4-15 20:19:16 | 显示全部楼层
1.首先建议您最好再多跟踪一下代码,找到更详细的异常信息.. 看看是不是路径的问题. 2.一般情况是在调用System.Drawing.Image.Save时出现的错误.写入文件时.NET没有这个目录的写入权限. 如果是ASPX,您可以增加IIS对此目录的写入权限....
回复

使用道具 举报

千问 | 2009-4-15 20:19:16 | 显示全部楼层
2楼的真幽默,哈哈,ASP.NET 就快学到了。。...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行