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

    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. 关于string.format() 转

    string.format()函数用来生成具有特定格式的字符串,这个函数有两个参数,第一个参数为格式化串:由指示符和控制格式的字符组成.第二个参数是对应格式中每个代号的各种数据. 格式字符串可能包含以 ...

  2. Nginx 和 Apache 开启目录浏览功能

    1.Nginx 在相应项目的 Server 段中的 location 段中,添加 autoindex on.例如: server { listen ; server_name www.dee.prac ...

  3. swift-懒加载

    override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.cyan self.navi ...

  4. Unity字节序问题

    问题 Unity中有些配置信息并不想在发布之后给其他人看到,所以在打包的时候进行了简单的编码处理,然后保存为.bytes类型,读取的时候再进行解码处理.今天遇到的很奇葩的问题是: 如果bytes文件U ...

  5. Spring mvc example

    Spring mvc example 1.下载spring源包 spring地址:http://www.springsource.org/download 我下的是spring-framework-3 ...

  6. 关于 Pragma 的使用总结

    注意:此文乃是本人阅读多个博客文章后,记下的个人认为重点的地方. 参考文章: 参考1   参考2 #Pragma mark - 用于分离类中的不同功能的方法.(例如,一个 viewController ...

  7. snmp ubuntu/centos--

    软件安装 切换到系统管理员帐户 安装snmp确认snmp代理已安装rpm -q net-snmp如果未安装,安装snmpyum install net-snmp 设置开机自动运行snmp/sbin/c ...

  8. RGB转YCbCr

    从RGB转换成YCbCr //  Purpose:      //          Save RGB->YCC colorspace conversion for reuse, only co ...

  9. Java语言程序设计(基础篇) 第七章 一维数组

    第七章 一维数组 7.2 数组的基础知识 1.一旦数组被创建,它的大小是固定的.使用一个数组引用变量,通过下标来访问数组中的元素. 2.数组是用来存储数据的集合,但是,通常我们会发现把数组看作一个存储 ...

  10. break和continue

    break语句会终止循环,continue会在执行过程中返回循环的开头.