ASP.netとC#コードを使用してWebページのスクリーンショットを撮り、それをサーバーに送信することはできますか?このコードでは、ローカルホストのみにアクセスしますが、同じソースコードでは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");