0

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!

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Momerath
0

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;

Edited by mike_2000_17: Fixed formatting

0

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

We all have exploring to do.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.