加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 当我调用Bitmap.Save函数时出现错误“GDI中发生了一般错误

发布时间:2020-12-16 01:33:24 所属栏目:百科 来源:网络整理
导读:当我调用Bitmap.Save函数时,会出现此错误:“GDI中发生了一般错误”.当我从localhost调用它时,它工作,但当我从另一台计算机调用时,会发生此错误. ‘/ jobnumber’应用程序中的服务器错误: A generic error occurred in GDI+. Description: An unhandled exc
当我调用Bitmap.Save函数时,会出现此错误:“GDI中发生了一般错误”.当我从localhost调用它时,它工作,但当我从另一台计算机调用时,会发生此错误.

‘/ jobnumber’应用程序中的服务器错误:

A generic error occurred in GDI+.
Description: An unhandled exception
occurred during the execution of the
current web request. Please review the
stack trace for more information about
the error and where it originated in
the code.

例外细节:

System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.

来源错误:

An unhandled exception was generated
during the execution of the current
web request. Information regarding the
origin and location of the exception
can be identified using the exception
stack trace below.

堆栈跟踪:

[ExternalException (0x80004005): A
generic error occurred in GDI+.]
System.Drawing.Image.Save(String
filename,ImageCodecInfo encoder,
EncoderParameters encoderParams)
+377518 System.Drawing.Image.Save(String
filename,ImageFormat format) +69
System.Drawing.Image.Save(String
filename) +25
Assignment.CreateBitmapImage(String
sImageText,Image Image1,JobInfo
job_info_param) +124
Assignment.PrintButton_Click(Object
sender,EventArgs e) +271
System.Web.UI.WebControls.Button.OnClick(EventArgs
e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl,String eventArgument)
+13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint,Boolean
includeStagesAfterAsyncPoint) +1565

解决方法

这通常表示Web用户(例如IIS_USR)无权使用
将任何数据保存到您在Web服务器上保存位图的文件夹中.

我之前遇到过类似的问题.检查服务器上该文件夹的访问权限.首先让每个人都可以完全访问该文件夹(只是为了确保问题),然后再将其缩小,以便只有所需的用户才能访问.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读