开发者

How can I take a screenshot of a website w/ .NET?

I'm looking for ideas on how to take screenshots of websites within a .NET application. This application will be a w开发者_如何学编程indows service. Thanks!


Check out the following links:

http://pietschsoft.com/post/2008/07/C-Generate-WebPage-Thumbmail-Screenshot-Image.aspx

http://www.dotnetspider.com/resources/28436-Code-get-screenshot-webpage.aspx


You can't show forms with WindowsServices. However, try to create a Form, with WebBrowser component, fill-in URL, browser.OnPageLoaded => myBrowser.DrawToBitmap.. who knows.


You can host the MSHTML component and have it load the page and then print it to a metafile, which can then be player or converted to a bitmap.

Note, however, that the MSHTML component may not work correctly when run as service without visual UI (e.g. without desktop interaction).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜