CefSharp LoadHtml

后端 未结 3 2003
北恋
北恋 2021-01-01 17:52

Could someone explain to me how the CefSharp LoadHtml function works?

LoadHtml(string html, string url)

What do the html

3条回答
  •  轮回少年
    2021-01-01 18:13

    Try the following code

    Cef.Initialize(new CefSettings());
    
    ChromiumWebBrowser browser = new ChromiumWebBrowser(string.Empty) {
        Location = new Point(0, 0),
        Dock = DockStyle.Fill
    };
    
    //add to a System.Windows.Forms.Form or some other container.
    this.Controls.Add(browser);
    //the url parameter does not have to be an existing address.
    browser.LoadHtml("

    Hello, World!

    ", "http://www.example.com/");

    Hope this helps.

提交回复
热议问题