How to make a System.Windows.Control WebBrowser.Document file in mshtml.MSHTMLDocumentClass?

I have WebBrowserone that loads inside a WPF window. I need to get the name of the webpage loaded in WebBrowser.

I get a document using

object doc = this._browser.Document;, and I see what it is mshtml.MSHTMLDocument, and I want to use it as this type so that I can pull out the header, however I cannot find this type in any .NET library.

Should I create the type myself or am I just looking for the wrong place / approaching this wrong way?

How can I get the page title from a document System.Windows.Controls.WebBrowser?

+4
source share
1 answer

Microsoft.mshtml, :

var title = (webBrowser.Document as mshtml.HTMLDocument).title;

dynamic doc = webBrowser.Document;
var title = doc.title;
+8

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


All Articles