Save the image in asp.net using C#
When i run the local machine the image saves.
But when i run in the server error shows as follows:
My code as follows:
Bitmap bitmap = new Bitmap(990, 540);
Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);
graphics.CopyFromScreen(5, 160, 0, 0, bitmap.Size);
bitmap.Save(@"\\director\transfer\staff\NIRANJAN\" + ddlSession.Text.ToString().Trim() + "DailySchedule.bmp", ImageFormat.Bmp);
The error shows as follows:
Exception Details: System.ComponentModel.Win32Exception:
The handle is invalid
Line 35: graphics.CopyFromScreen(5, 160, 0, 0, bitmap.Size);
please help me.
what is the problem
Regards,
Narasiman P.