繁体   English   中英

使用SSL的C#CefSharp WinForms连接(白屏)

[英]C# CefSharp WinForms Connection Using SSL (White Screen)

我将Cefsharp for Winforms版本63.0.3嵌入WPF中的Windows Forms Host中。 我尝试运行简单的示例,并在Windows Forms Host中使用winforms CefSharp正常工作。 https://www.google.com )图片: https : //imgur.com/HCKHj8n

但是,当我使用其他ssl url时,却呈现白色屏幕而不是网站。 https://portal.aoacloud.com.tw/desk_auth_index.php )图片: https : //imgur.com/vzw728C

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());
}
}
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM