How to use C # to capture an image of a specific url?

How to use C # to capture image specific URL?

I want to use C # to automatically capture an image of a web page based on a specific URL.

For example, I have a page txtUrl.Text = " http://www.some.com/index.aspx ", then I press a button, how can I capture an image of this Url?

+3
source share
3 answers

I assume that you want to do this from ASP.NET (as opposed to a WinForms application).

- System.Windows.Forms(, , ). System.Windows.Forms.WebBrowser:

WebBrowser browser = new WebBrowser();
// this will load up a URL into the web browser:
browser.Navigate(@"http://www.stackoverflow.com"); 

, BitBlt API (, ), WebBrowser Bitmap ( ). WebBrowser Handle .

: - , , : http://www.developerfusion.com/code/4712/generate-an-image-of-a-web-page/

+2

-, IE . ( -) this ( #). , , IE.

- shotserver shotfactory, browsershots.org. , , .NET API.

+2

, #. , # .NET - HTML. , , , - WebBrowser, - ( ).

Another way to do this is to look for a .NET component that could do what you want. Although I don’t know what to do.

0
source

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


All Articles