没有浏览器控件类的C#Web浏览器

时间:2016-10-25 17:20:02

标签: c# http webbrowser-control

我正在尝试制作高级C#网络浏览器(导航,收藏夹,主页,历史记录,标签页)而不使用visual studio中的WebBrowser控件。我在网上找不到任何教程。谁可以帮助教程?

到目前为止我已经开始了

 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();
}

1 个答案:

答案 0 :(得分:2)

GeckoFXCefSharp是最新的软件包(可以在NuGet上找到),可以将浏览器嵌入到应用程序中。

我认为从零开始编写Web浏览器应该太辛苦和昂贵。