• 大小: 29.4MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-04
  • 语言: C#
  • 标签: Winform  CefS  

资源简介

Winform集成CefSharp,CefSharp单独目录 https://blog.csdn.net/a497785609/article/details/80678787

资源截图

代码片段和文件信息

using System;
using System.IO;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;

namespace CefDemo
{
    public partial class Form1 : Form
    {
        private static string lib browser locales res;
        private ChromiumWebBrowser _browser;

        public Form1()
        {
            InitializeComponent();
            InitBrowser();
        }

        public void InitBrowser()
        {
            lib = Path.Combine(AppDomain.CurrentDomain.baseDirectory @“resources\cefsharp_x86\libcef.dll“);
            browser = Path.Combine(AppDomain.CurrentDomain.baseDirectory@“resources\cefsharp_x86\CefSharp.BrowserSubprocess.exe“);
            locales = Path.Combine(AppDomain.CurrentDomain.baseDirectory @“resources\cefsharp_x86\locales\“);
            res = Path.Combine(AppDomain.CurrentDomain.baseDirectory @“resources\cefsharp_x86\“);

            var libraryLoader = new CefLibraryHandle(lib);
            var isValid = !libraryLoader.IsInvalid;
            if (isValid)
            {
                InitSetting();
                _browser = new ChromiumWebBrowser(“http://www.baidu.com“);
                panel.Controls.Add(_browser);
                _browser.Dock = Dockstyle.Fill;
            }
        }

        private void Form1_Load(object sender EventArgs e)
        {
        }

        private void InitSetting()
        {
            var settings = new CefSettings
            {
                BrowserSubprocessPath = browser
                LocalesDirPath = locales
                ResourcesDirPath = res
            };
            Cef.Initialize(settings false false);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        160  2018-06-13 14:37  CefDemo\app.config

     文件       8704  2018-06-13 14:45  CefDemo\bin\Debug\CefDemo.exe

     文件        160  2018-06-13 14:37  CefDemo\bin\Debug\CefDemo.exe.config

     文件      19968  2018-06-13 14:45  CefDemo\bin\Debug\CefDemo.pdb

     文件      11600  2018-06-13 10:01  CefDemo\bin\Debug\CefDemo.vshost.exe

     文件        144  2018-06-13 10:01  CefDemo\bin\Debug\CefDemo.vshost.exe.config

     文件        490  2012-06-06 02:06  CefDemo\bin\Debug\CefDemo.vshost.exe.manifest

     文件     796672  2016-08-28 14:58  CefDemo\bin\Debug\CefSharp.BrowserSubprocess.Core.dll

     文件    1174016  2016-08-28 14:58  CefDemo\bin\Debug\CefSharp.Core.dll

     文件      49366  2016-08-28 14:58  CefDemo\bin\Debug\CefSharp.Core.xml

     文件     163328  2016-08-28 14:58  CefDemo\bin\Debug\CefSharp.dll

     文件      22016  2016-08-28 14:58  CefDemo\bin\Debug\CefSharp.WinForms.dll

     文件      37795  2016-08-28 14:58  CefDemo\bin\Debug\CefSharp.WinForms.xml

     文件     360173  2016-08-28 14:58  CefDemo\bin\Debug\CefSharp.xml

     文件      10813  2018-06-13 14:46  CefDemo\bin\Debug\debug.log

     文件    2749972  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\cef.pak

     文件     796672  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\CefSharp.BrowserSubprocess.Core.dll

     文件       8704  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\CefSharp.BrowserSubprocess.exe

     文件    1174016  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\CefSharp.Core.dll

     文件      49366  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\CefSharp.Core.xml

     文件     163328  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\CefSharp.dll

     文件      22016  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\CefSharp.WinForms.dll

     文件      37795  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\CefSharp.WinForms.xml

     文件     360173  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\CefSharp.xml

     文件     146067  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\cef_100_percent.pak

     文件     235262  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\cef_200_percent.pak

     文件    4409164  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\cef_extensions.pak

     文件    2106216  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\d3dcompiler_43.dll

     文件    3709120  2016-08-28 14:58  CefDemo\bin\Debug\resources\cefsharp_x86\d3dcompiler_47.dll

     文件        819  2018-06-13 10:27  CefDemo\bin\Debug\resources\cefsharp_x86\debug.log

............此处省略104个文件信息

评论

共有 条评论