.._winform嵌套网页">
赞
踩
第一步,创建winform项目
第二步,修改创建项目的proj文件加入代码:
<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
第三步,修改app.config
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <probing privatePath="x86"/>
- </assemblyBinding>
- </runtime>
第四步,设置
第五步,查看Form1的cs,加入方法
- public Form1()
- {
- InitializeComponent();
- InitializeChromium();
- }
- public ChromiumWebBrowser chromeBrowser;
- public void InitializeChromium()
- {
- CefSettings settings = new CefSettings();
- // Initialize cef with the provided settings
- Cef.Initialize(settings);
- // Create a browser component
- chromeBrowser = new ChromiumWebBrowser("https://blog.csdn.net/xingkongtianyuzhao/article/details/103646371");
- // Add it to the form and fill it to the form window.
- this.Controls.Add(chromeBrowser);
- chromeBrowser.Dock = DockStyle.Fill;
- }
-
- private void Form1_FormClosing(object sender, FormClosingEventArgs e)
- {
- Cef.Shutdown();
- }
最后,运行,
不懂可私聊我
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。