Read Title of the web page in web browser control
I am very new to C#, I am trying to do some web service request to my server. This app is for windows mobile 6.
I have used web browser to load a page from the server. I need to know the Title of the page which has been returned.
I googled and found found solutions like try using HTMLDocument, webbrowser1.DocumentText etc. But none of them worked.
I request help from the experts he开发者_运维问答re, how I can over come this problem?
Some solutions which came to my mind are:
Download the file using some way and store it in a temp directory and load the web browser with the local URL. ==> Any API's for doing this is available?
is there a possibility of using xmlhttprequest methods to get the info? ==> if so how? any sample of using this method in C#?
Any kind of information, links, samples etc., would be of great help.
Thanks in advance,
Regards, VinayImplement the Document Completed
event and you can get the title below is the code for the same:
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
tabControl1.SelectedTab.Text = webBrowser1.DocumentTitle;
}
I did some extensive search and could not find the solution.
As an alternative, I did a HttpWebRequest and saved the file locally after parsing the Title and loaded the same to webBrowser object.
精彩评论