用更好的浏览器(如 Chrome)替换 .NET WebBrowser 控件? [英] Replacing .NET WebBrowser control with a better browser, like Chrome?
问题描述
是否有任何相对简单的方法可以将现代浏览器插入到 .NET 应用程序中?
Is there any relatively easy way to insert a modern browser into a .NET application?
据我所知,WebBrowser
控件是 IE 的包装器,这不会有问题,只是看起来它是一个非常旧的版本IE 的所有内容,包括 CSS 错误、潜在的安全风险(如果渲染引擎没有打补丁,我真的能指望修复无数缓冲区溢出问题吗?),和其他问题.
As far as I understand, the WebBrowser
control is a wrapper for IE, which wouldn't be a problem except that it looks like it is a very old version of IE, with all that entails in terms of CSS screw-ups, potential security risks (if the rendering engine wasn't patched, can I really expect the zillion buffer overflow problems to be fixed?), and other issues.
我正在使用 Visual Studio C#(快速版 - 在这里有什么不同吗?)
I am using Visual Studio C# (express edition - does it make any difference here?)
我想在我的应用程序中集成一个好的网络浏览器.在某些情况下,我只是用它来处理用户注册过程、与我网站的一些功能和其他顺序的交互,但我有另一个应用程序需要更多的错误......控制.
I would like to integrate a good web browser in my applications. In some, I just use it to handle the user registration process, interface with some of my website's features and other things of that order, but I have another application in mind that will require more err... control.
我需要:
- 可以集成到我的应用程序窗口(不是单独的窗口)中的浏览器
- 对 CSS、js 和其他网络技术的良好支持,可与任何现代浏览器相媲美
- 基本浏览器功能,如导航"、返回"、重新加载"...
- 对页面代码和输出的自由访问.
我在考虑 Chrome,因为它获得了 BSD 许可,但我对 IE 的最新版本也很满意.
I was thinking about Chrome, since it comes under the BSD license, but I would be just as happy with a recent version of IE.
尽可能地,我想让事情保持简单.最好的办法是,如果可以修补现有的 WebBrowser
控件,它已经完成了我需要的大约 70% 的功能,但我认为这是不可能的.
As much as possible, I would like to keep things simple. The best would be if one could patch the existing WebBrowser
control, which does already about 70% of what I need, but I don't think that's possible.
我找到了 Mozilla 的 activeX 控件(http://www.iol.ie/~locka/mozilla/control.htm) 但它看起来像旧版本,所以不一定是改进.
I have found an activeX control for Mozilla (http://www.iol.ie/~locka/mozilla/control.htm) but it looks like it's an old version, so it's not necessarily an improvement.
我愿意接受建议
推荐答案
Checkout CefSharp .Net 绑定,这是我不久前开始的一个项目,幸运的是它得到了社区并变成了美好的事物.
Checkout CefSharp .Net bindings, a project I started a while back that thankfully got picked up by the community and turned into something wonderful.
该项目封装了 Chromium 嵌入式框架,并已在多个主要项目中使用,包括 Rdio 的 Windows 客户端、Windows 版 Facebook Messenger 和 Windows 版 Github.
The project wraps the Chromium Embedded Framework and has been used in a number of major projects including Rdio's Windows client, Facebook Messenger for Windows and Github for Windows.
它具有用于 WPF 和 Winforms 的浏览器控件,并具有大量功能和扩展点.基于 Chromium,它的速度也非常快.
It features browser controls for WPF and Winforms and has tons of features and extension points. Being based on Chromium it's blisteringly fast too.
从 NuGet 获取:Install-Package CefSharp.Wpf
或 Install-Package CefSharp.WinForms
Grab it from NuGet: Install-Package CefSharp.Wpf
or Install-Package CefSharp.WinForms
查看示例并给出您的想法/反馈/pull-requests:https://github.com/cefsharp/CefSharp
Check out examples and give your thoughts/feedback/pull-requests: https://github.com/cefsharp/CefSharp
BSD 许可
这篇关于用更好的浏览器(如 Chrome)替换 .NET WebBrowser 控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!