我正在将 Cefsharp for Winforms 版本 63.0.3 嵌入到 WPF 中的 Windows Forms Host 中。我已经尝试运行简单的示例,并在Windows Forms Host中使用winforms CefSharp工作正常。(https://www.google.com(图片:https://i.stack.imgur.com/Rrt7z.jpg
但是,当我使用其他 ssl url 时,但呈现白屏而不是网站。(https://portal.aoacloud.com.tw/desk_auth_index.php(图片:https://i.stack.imgur.com/K9apw.jpg
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitBrowser();
}
public ChromiumWebBrowser browser;
private void InitBrowser()
{
CefSettings cfsettings = new CefSettings();
cfsettings.IgnoreCertificateErrors = true;
Cef.Initialize(cfsettings);
browser = new ChromiumWebBrowser("https://portal.aoacloud.com.tw/desk_auth_index.php");
browser.Dock = DockStyle.None;
this.browser.Size = new Size(321, 421);
this.browser.Location = new Point(259, 37);
this.Controls.Add(browser);
}
}
}
我在这里找到答案表格https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting
using System;
using System.Windows.Forms;
using CefSharp;
namespace CefBlog3
{
static class Program
{
[STAThread]
static void Main()
{
Cef.Initialize(new CefSettings() { CachePath = "Cache" } );
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}