我需要一个Gecko WebBrowser控件
我需要一个示例代码或一个说明如何使用GECKO的链接
如果有人使用过Gecko,我可以提出一些建议
解决方案可以找到带有详细快照的原始教程
- 添加对dll的引用,如上所示,单击浏览并选择Geckofx-Core.dll和Geckofx-Winforms.dll
- 在工具箱中,右键单击,然后选择选择项目,选择Geckofx-Winforms.dll,然后将显示Gecko winform控件。在工具箱中
-
将GeckoWebBrowser控件拖到winform设计器中,我们称之为浏览器
-
在form1.cs文件中,添加以下代码:
行Gecko.Xpcom.Initialize(@ .. \xulrunner) ;指定xulrunner运行时所在的位置。在这种情况下,我们将其放入文件夹(@ .. \xulrunner)。
现在运行应用程序,是的~~~
I need a Gecko WebBrowser Control
I need a sample code or a link which explains how to use GECKO
If anyone has used Gecko, I could do with some advice
解决方案Original tutorial with detailed snapshots can be found here.
A most recent update can be found here. Please upvote in that article if you find it useful :)
To embed Gecko browser in your winform application, you need:
- XulRunner: XULRunner is a Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications that are as rich as Firefox and Thunderbird. It provides mechanisms for installing, upgrading, and uninstalling these applications. XULRunner can be downloaded here. Choose the version you like.
GeckoFx assembly file, which you can download from here. Also choose the correct version which matches the XulRunner version.
Unpack the GeckoFX-330.zip, you will get below files:
- Add references to the dlls as shown above, click browse and select the Geckofx-Core.dll and Geckofx-Winforms.dll
- In the toolbox, right click, and then select "Choose Item", select Geckofx-Winforms.dll, and the Gecko winform control will be shown in the toolbox
Drag a GeckoWebBrowser control to the winform designer, and let’s call it "browser"
In the form1.cs file, add below code:
The line Gecko.Xpcom.Initialize(@"..\xulrunner"); specifies where the xulrunner runtime is located. In this case, we put it into a folder (@"..\xulrunner").
Now run the application, yeah~~~
更多推荐
如何在C#中使用Gecko
发布评论