HI All,
I am facing a problem from past few days on server environment. I have created the code for taking the screen shot of the windows as follow...This code is perfectly working in Run time environment. While running and debugging the application it is working fine.
But once i configured this website on Windows server 2008 or Server 2012 it is not working it hangs out the application at the method graphics.CopyFromScreen().
I am unable to find out the solution for this from last few day's. please help me to fix it. The code is as follow.
Bitmap bitmap = new Bitmap(600, 500);
Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image); // The application hangs at this pt
graphics.CopyFromScreen(160, 235, 0, 0, bitmap.Size);
string mappath = Server.MapPath("~/dimurl/image/");
bitmap.Save(mappath + "myfile.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
Please help me to resolve this.
Vaibhav Bhutkar, Jr. .Net Developer, Pune India.