Most web browsers print the web site's title in the form text. So I want to do the same thing on navigation if possible.

// Only prints the URL. So please help.
string siteName = webBrowser.Url.Host;
this.Text = siteName;

Much thanks!

Recommended Answers

All 3 Replies

It's in the header section of the page, something like

<title>SQL Server 2008 Connection String Samples - ConnectionStrings.com</title>

Having only played with the webbrowser control, I'm not sure how you'd get that. Ah, there it is, in the HtmlDocument.Title property (which you get through the WebBrowser.Document property). So something like

this.Text = webbrowser1.Document.Title;

Thank you, just goes to show how much more exploring I have to do. :D

As of the .NET 3.5 framework there were:
98 Assemblies
309 Namespaces
11417 Types
109657 Members

We all have exploring to do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.