使用C#简单broswer [英] Simple broswer using C#

查看:122
本文介绍了使用C#简单broswer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#中创建一个简单的浏览器,可以使用http响应获取http请求并显示结果。



我尝试过:



How to create a simple browser in c# that can get http request and show result using http response.

What I have tried:

How to create a simple browser in c# that can get http request and show result using http response.

推荐答案

在C#或.NET Framework中,您可以使用 WebBrowser [ ^ ]控件创建一个充当一个网络浏览器。请记住,它由Internet Explorer(计算机上安装的那个,也可以是IE 8)支持。这可以作为入门应用程序使用,让您立即启动并运行。然而,由于发动机不良,不建议这样做。



您可以尝试这个有点复杂的解决方案并将其视为替代方案, CefSharp - WinForms和WPF应用程序的快速Web浏览器 [ ^ ],它是基于Chromium引擎,您可以在浏览器中获得更好的结果,而无需自己修改很多东西。



阅读本文,了解更多内容,使用.NET的WebBrowser控件创建自定义Web浏览器 [ ^ ]
In C#, or .NET Framework you can use the WebBrowser[^] control to create an application that acts as a web browser. Remember, that it is backed by Internet Explorer (the one installed on the machine, and can be IE 8 too). This can be used as a starter application and will have you up and running in no time. Whereas, this is not recommended because of the poor engine.

You can try this a bit complex solution and consider it as an alternate, CefSharp - Fast web browser for WinForms and WPF Apps[^], it is based on Chromium engine and you can get somewhat better results in the browser without having to modify a lot of things yourself.

Read this article of mine to understand a bit more on this, Creating a custom Web Browser using .NET's WebBrowser Control[^]


编写一个简单的浏览器划痕是一项非常复杂的任务。



那么为什么不使用现有的像WebBrowser Class(System.Windows.Forms) [ ^ ]?



如果您不想使用它,可以使用 HttpClient类(System.Net.Http) [ ^ ]发送请求并接收回复。但是你必须自己实现显示功能(当内容应该像其他浏览器一样呈现时,这是一项复杂的任务)。
Writing even a simple browser from scratch is a very complex task.

So why not use an existing one like the WebBrowser Class (System.Windows.Forms)[^]?

If you don't want to use that you can use the HttpClient Class (System.Net.Http)[^] to send requests and receive the responses. But then you have to implement the display function yourself (which is the complex task when the content should be rendered like with other browsers).


这篇关于使用C#简单broswer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆