Click here to Skip to main content
11,432,627 members (52,819 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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 12-Feb-13 2:05am
Edited 12-Feb-13 2:40am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.150428.2 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100