Kronos
Kronos

Reputation: 41

C# web browser without browser control class

I'm trying to make an advanced C# web browser (navigation, favorites, home, history, tabs) without using the WebBrowser control in visual studio. I can't find any tutorials online. Anyone who can help with a tutorial?

I've so far started with

 string urlAddress = "http://google.com";

 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlAddress);
 HttpWebResponse response = (HttpWebResponse)request.GetResponse();

 if (response.StatusCode == HttpStatusCode.OK)
{
   Stream receiveStream = response.GetResponseStream();
   StreamReader readStream = null;

   if (response.CharacterSet == null)
  {
      readStream = new StreamReader(receiveStream);
  }
   else
  {
      readStream = new StreamReader(receiveStream,                                                    Encoding.GetEncoding(response.CharacterSet));
  }

   string data = readStream.ReadToEnd();

   response.Close();
   readStream.Close();
}

Upvotes: 4

Views: 1292

Answers (1)

Francesco
Francesco

Reputation: 130

GeckoFX and CefSharp are the most updated packages (you can find them on NuGet) to embed a browser in your application.

I think that writing a web browser from nothing should be too much hard and expensive.

Upvotes: 2

Related Questions