c#使用CefSharp开发winform——环境搭建
<p>因为nuget在线下载有时间很慢,以是下载nuget包,举行本地安装</p><p>登岸nuget官网<a href="https://www.nuget.org/" data-cke-saved-href="https://www.nuget.org/">https://www.nuget.org/</a>下载干系资源</p>
<p> </p>
<p></p>
<p> </p>
<p> </p>
<p> </p>
<p>选择对应版本举行下载,同时须要下载干系依赖的包</p>
<p></p>
<p> </p>
<p> </p>
<p> </p>
<p><imgtitle="点击并拖拽以移动" src="https://www.cnblogs.com/data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="width="15" height="15" data-cke-widget-drag-handler="1" /></p>
<p>终极下载的共4个包,cef.redist64,cef.redist86,cefsharp.common,cefsharp.winforms</p>
<p></p>
<p> </p>
<p> </p>
<p> </p>
<p><imgtitle="点击并拖拽以移动" src="https://www.cnblogs.com/data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="width="15" height="15" data-cke-widget-drag-handler="1" /></p>
<p>打开visual studio(这里用vs2013为例),打开步伐包管理器设置,添加本地nuget选项,我这里定名为CEFLocal</p>
<p> </p>
<p> </p>
<p> </p>
<p><imgtitle="点击并拖拽以移动" src="https://www.cnblogs.com/data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="width="15" height="15" data-cke-widget-drag-handler="1" /></p>
<p> </p>
<p> </p>
<p><imgtitle="点击并拖拽以移动" src="https://www.cnblogs.com/data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="width="15" height="15" data-cke-widget-drag-handler="1" /></p>
<p>设置完毕后打开nuget管理器,就可以看到本地下载的nuget包举行安装</p>
<p></p>
<p> </p>
<p> </p>
<p><imgtitle="点击并拖拽以移动" src="https://www.cnblogs.com/data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="width="15" height="15" data-cke-widget-drag-handler="1" /></p>
<p>创建的winform项目举行天生设置,打开天生——配置管理器,在列表的平台栏目下对工程新建配置文件,选择x86</p>
<p></p>
<p> </p>
<p> </p>
<p><imgtitle="点击并拖拽以移动" src="https://www.cnblogs.com/data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="width="15" height="15" data-cke-widget-drag-handler="1" /></p>
<p></p>
<p> </p>
<p> </p>
<p><imgtitle="点击并拖拽以移动" src="https://www.cnblogs.com/data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="width="15" height="15" data-cke-widget-drag-handler="1" /></p>
<p>末了测试下cefsharp的功能,在窗口加载事故贴入代码</p>
private void Form1_Load(object sender, EventArgs e)
{
InitializeComponent();
//必须举行初始化,否则就出来页面啦。
CefSharp.Cef.Initialize();
//实例化控件
ChromiumWebBrowser wb = new ChromiumWebBrowser("https://wwww.baidu.com");
//设置停靠方式
wb.Dock = DockStyle.Fill;
//参加到当前窗体中
this.Controls.Add(wb);
}
<p> </p>
<imgtitle="点击并拖拽以移动" src="https://www.cnblogs.com/data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="width="15" height="15" data-cke-widget-drag-handler="1" />
<p></p>
<p> </p>
<p> </p>
<p><imgtitle="点击并拖拽以移动" src="https://www.cnblogs.com/data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="width="15" height="15" data-cke-widget-drag-handler="1" /><br /></p>
页:
[1]