Is it possible to take a screenshot of a webpage using ASP.net with C # code

Is it possible to take a screenshot of a web page with ASP.net with C # code and then send it back to the server? In this code, access is only to the local host, but the same source code that does not have access to IIS is CopyFromScreen . What is the reason, is this possible?

Source code example:

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");
+3
source share
2 answers

I am a bit confused. Do you take a screenshot of the server and save it there? What's the point?

What exactly needs to be done here? If you want to take a screenshot of a web page, you may need to look at the question .

: .Net-?

ere -

0

( JPG) -, , (, ). - - HTML , :

WebRequest wrContent = WebRequest.Create("http://www.destsite.com/yourpage.aspx");
Stream objStream = wrContent.GetResponse().GetResponseStream();
StreamReader objStreamReader = new StreamReader(objStream);
string pageContent = objStreamReader.ReadToEnd();

, ... - , .

0

Source: https://habr.com/ru/post/1710308/


All Articles