开发者

Printing a WebBrowser in a foreach loop

I have a collection of URLs in an arra开发者_JAVA技巧ylist. Now, I need to print the webpage in each URL using the WebBrowser control in my Windows Forms applcaition. Can anyone please help me out on how to do this? Thank you.


1). Call IWebBrowser2.Navigate(..) to start loading a document. 2). Handle NavigateComplete() event. When the document is loaded you can print it: IHTMLDocument2.execCommand("print", null, null)

In the real world you need to handle errors, provide timeouts, as url can be wrond, server could be down etc.

Good luck!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜