Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody

I want develop a Windows form application as web browser.
I use from bellow code:

WebRequest request = WebRequest.Create(this.Url.Text);
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();
StreamReader reader = new StreamReader(stream);

this.WebBrowser.DocumentText = reader.ReadToEnd();
                
reader.Close();


But I have an error.
this code only create a request while most of web site have many Url therefore I must create a request for any Url in website.

How I can load whole of web site files and direction???

Please help me

Thank a lot
Posted
Updated 12-Feb-13 1:40am
v2

 
Share this answer
 
Hi every body

I solved my problem by bellow code:

private WebBrowser GetCurrentBrowser()
{
    return (WebBrowser)TabControl.SelectedTab.Controls[0];
}

private void GoPage()
{
    GetCurrentBrowser().Navigate(UrlTextBox.Text);
}


Thanks a lot
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900