代码挺差的,仅供学习、参考

    class CEFGlueLoader
{
class CefAppImpl : CefApp
{
protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
{
commandLine.AppendArgument("enable-npapi");
commandLine.AppendSwitch("enable-media-stream", "enable-media-stream");
commandLine.AppendSwitch("process-per-site");
commandLine.AppendSwitch("ppapi-flash-version", "23.0.0.185");//PepperFlash\manifest.json中的version
commandLine.AppendSwitch("ppapi-flash-path", "PepperFlash\\pepflashplayer.dll");
}
} public static void InitCEF()
{
#if !_ORG_MANAGER && !_MBMAKER
CefRuntime.Load();
string[] args = new string[];
var mainArgs = new CefMainArgs(args);
var app = new CefAppImpl();
var exitCode = CefRuntime.ExecuteProcess(mainArgs, app);
System.Diagnostics.Trace.WriteLine("CefRuntime.ExecuteProcess return: " + exitCode);
if (exitCode != -)
{
return;
} var settings = new CefSettings
{
BrowserSubprocessPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"bin\Cef3Process.exe"),
SingleProcess = false,
MultiThreadedMessageLoop = true,
LogSeverity = CefLogSeverity.Default,
LogFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"log\CefGlue.log"),
CachePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"cache"),
CommandLineArgsDisabled = true,
Locale = "zh_CN",
LocalesDirPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"bin\locales"),
RemoteDebuggingPort = , };
CefRuntime.Initialize(mainArgs, settings, app); if (!settings.MultiThreadedMessageLoop)
{
System.Windows.Forms.Application.Idle += (sender, e) => { CefRuntime.DoMessageLoopWork(); };
}
#endif
} private static string GetPath(string v)
{
return Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, v));
} public static void ShutDownCEF()
{
#if !_ORG_MANAGER && !_MBMAKER
try
{
CefRuntime.Shutdown();
}
catch (Exception)
{
}
#endif
}
}

C# : CEF操作的更多相关文章

  1. CEF 支持JSON操作

    转载:https://blog.csdn.net/foruok/article/details/50687864(解析json) 转载:https://blog.csdn.net/foruok/art ...

  2. cisco 下CEF(简介)[转载]

    cisco 下CEF(简介) 转自:http://blog.51cto.com/chengmingshu/803358 cms_cmd1人评论2570人阅读2012-03-12 00:09:29   ...

  3. qt添加cef库嵌入web [转]

    qt cef嵌入web 原文http://blog.sina.com.cn/s/blog_9e59cf590102vnfc.html 最近项目需要,研究了下libcef库. Cef(Chromium ...

  4. 使用C#在CEF中拦截并响应请求

    一.前言 忙里偷闲,研究了一下如何在CEF中拦截请求,并作出响应.这个功能对某些需要修改服务器响应的需求来说必不可少,可以直接读取本地文件作为响应内容. C#的CEF封装项目有很多,我使用的是Chro ...

  5. Duilib嵌入CEF以及JavaScript与C++交互

    转载:http://blog.csdn.net/foruok/article/details/50573612 转载:http://blog.csdn.net/foruok/article/detai ...

  6. 初识CEF

    介绍 CEF全称Chromium Embedded Framework,是一个基于Google Chromium 的开源项目.Google Chromium项目主要是为Google Chrome应用开 ...

  7. CEF使用的几个注意点

    CEF为chrome浏览器的切入其他浏览器中的轻量级框架. 开发的客户端的时候,这是作为界面显示的首先,可以增强客户的易变性,可塑性. 在开发的过程中(侧重于C,C++解决),遇到的几个问题,以及自己 ...

  8. 允许CEF跨域访问iframe

    默认情况下,如果嵌入本地Web页面,并在页面内部使用iframe来显示一个在线页面,加载的过程中会触发一个未捕获异常,虚函数CefV8ContextHandler::OnUncaughtExcepti ...

  9. CEF中文教程(google chrome浏览器控件) -- Windows下编译Chromium

    CEF中文教程(google chrome浏览器控件) -- CEF简介 2013-04-10 16:48 42928人阅读 评论(4) 收藏 举报  分类: CEF(2)    目录(?)[+]   ...

随机推荐

  1. spring接收json格式的多个对象参数(变通法)

    两种方法 方法1 如果使用spring mvc同客户端通信,完全使用json数据格式,需要如下定义一个RequestMapping @Controller public class TestContr ...

  2. 采用DBCP连接池技术管理连接

    DBCP的使用步骤步骤一:导包,使用第三方的道具,必须导入相应的jar包. 一般需要导入两个jar包: -commons-dbcp-1.x.jar包 -commons-pool-1.x.x.jar包 ...

  3. .添加索引和类型,同时设定edgengram分词和charsplit分词

    1.添加索引和类型,同时设定edgengram分词和charsplit分词 curl -XPUT 'http://127.0.0.1:9200/userindex/' -d '{   "se ...

  4. 测试post接口curl

    function post($url,$data=array()) { if ( !empty($data) ) { $data=http_build_query($data); } $ch = cu ...

  5. maven常用插件pom配置

    一.问题描述: 部署一个maven打包项目时,jar包,依赖lib包全部手动上传至服务器,然后用maven部署报错:Exception in thread "main" java. ...

  6. 可爱的Python_课后习题_CDay−5 Python 初体验和原始需求

    计算今年是否是闰年.判断闰年条件,满足年份模400 为0,或者模4 为0 但模100不为0. def is_learp_year(year): """判断年份是否为润年& ...

  7. Git的.gitignore文件配置

    .gitignore是Git工具的配置文件,用于屏蔽某些文件上传到线上. 创建.gitignore 在window系统中,不允许新建文件名以"."开头的文件,所以通过git bas ...

  8. .NET client connection Limit

    调试出了一个诡异的问题,使用多个进程没问题,单进程出现了. fix: //默认限制为2个连接 //public const int DefaultPersistentConnectionLimit = ...

  9. 阿里 otter搭建过程整理

    1 环境说明: 本机ip 192.168.8.3 虚拟机1 ip 192.168.8.5 虚拟机2 ip 192.168.8.6 虚拟机采取桥接模式 虚拟机系统为CentOS 2.6.32-279.e ...

  10. iOS代码签名理解

    前言 做了几年iOS app coder了,对于证书的生成.使用流程烂熟于心,然而对于这套机制的原理却一直不甚理解.近来由于工作需要仔细研究了一下,特将自己的学习经验记录于此,以供大家学习指正. 问题 ...