【问题标题】:C# CefSharp WinForms Connection Using SSL (White Screen)使用 SSL 的 C# CefSharp WinForms 连接(白屏)
【发布时间】:2018-04-10 03:39:47
【问题描述】:

我将 Cefsharp for Winforms 63.0.3 版嵌入到 WPF 中的 Windows 窗体主机中。我试过运行这个简单的例子,并在 Windows 窗体主机中使用 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);
    }
}

}

【问题讨论】:

标签: c# cefsharp


【解决方案1】:

我在这里找到答案表 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());
}
}
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-20
    • 1970-01-01
    • 2016-08-22
    • 2020-07-04
    • 1970-01-01
    • 2018-06-03
    相关资源
    最近更新 更多