Server Error in '/' Application.

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.

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

Source Error:


Line 158:        using (Bitmap bm = oCaptcha.MakeCaptchaImage(sb.ToString(), 200, 100, "Arial"))
Line 159:        {
Line 160:            string url = Server.MapPath("~/images/code.bmp"); bm.Save(url);
Line 161:            ViewState["enquirecode"] = sb.ToString();
Line 162:            imgcode.Src = "~/images/code.bmp";

Source File: c:\inetpub\wwwroot\agentware.com.au\contact\enquiry.aspx.cs    Line: 160

Stack Trace:


[ExternalException (0x80004005): A generic error occurred in GDI+.]
   System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) +579
   aboutus_default.GenerateCode() in c:\inetpub\wwwroot\agentware.com.au\contact\enquiry.aspx.cs:160
   aboutus_default.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\agentware.com.au\contact\enquiry.aspx.cs:40
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4690.0