是否可以使用带有 C# 代码的 ASP.net 截取网页的屏幕截图,然后将其提交回服务器?在此代码中只能访问本地主机,但相同的源代码不能访问 IIS,出现CopyFromScreen错误。可能的原因是什么?
示例源代码:
Bitmap Bitmap;
Graphics Graps;
Bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height - 110, PixelFormat.Format32bppArgb);
Graps = Graphics.FromImage(Bitmap);
Graps.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, 110, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
Bitmap.Save(Server.MapPath("~") + "/YourShot.gif");