cefsharp

C#之使用CefSharp创建客户端

谁说胖子不能爱 提交于 2019-12-18 12:55:36
安装NuGet包 在Visio studio中右击解决方案,选择管理NuGet包,搜索安装CefSharp.WinForms。 配置工作 (1)首先右击项目选择属性,在"生成"选项中将"首选32位"勾上。 (2)其次在项目文件目录下找到"项目名称.csproj"文件,在第一个PropertyGroup中添加以下代码: <CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport> (3)最后修改App.config文件,和<startup>标签并列地位,添加以下代码: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="x86"/> </assemblyBinding> </runtime> 窗体代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows

使用CEF作为浏览器

怎甘沉沦 提交于 2019-12-18 12:55:24
c# 内嵌chrome (CEFSharp)首次 首先标记一个大坑!!!: 不管哪个版本,都需要在解决方案---配置管理器---平台---改为X86。否则一直打开是空白的窗口。坑了我一天都快炸了。 步骤一、创建一个winform应用程序。使用NuGet添加CefSharp。然后安装完成后,完全关闭vs并重新打开。(智障) cefsharp45及以上版本需要VC2013: https://www.microsoft.com/en-us/download/details.aspx?id=40784 步骤二、 这个教程说可以配置anycpu。配anycpu需要解决方案属性“首选32位”,改csproj和App.config文件。否则你看引用那一堆小叹号。此方法弃用。既然不能很好的支持anyCpu,就别出方法坑人了= =。最后还需要配置管理器改成平台X86才行。辣鸡。(但是nuget包下载后有个readme,第一条就是确保你设置了X86或X64.不会与anycpu一起工作。所以此攻略说的还是有毛病) 步骤二、在解决方案右键----“配置管理器”----平台---“X86”.(没找到选项就新建一个)。即可!! 步骤三、 using CefSharp; using CefSharp.WinForms;    public ChromiumWebBrowser chromeBrowser;

chromium - send custom header info on initial page load c#

橙三吉。 提交于 2019-12-17 16:37:29
问题 Or How to inject a custom header into the initial request to a site when new-ing up an instance of the ChromiumWebBrowser. I'm a noob with Chromium and could really use some help. I have a winforms app with a CEF window. K, no prob so far. What I need to do is to call/load the initial url with a custom http-header that contains authentication info. Is this possible? The following is essentially what is at play and all parts work except the custom header (Doh!) Winform(CEF httpRequest(with

cefsharp Frequently asked questions

久未见 提交于 2019-12-17 03:36:02
https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#Runtime_dependencies This FAQ tries to showcase some cool CefSharp features and some of the most common gotcha's. For an in-depth guide to many of the features please read General Usage Guide . For more hints see the growing list of issues labelled as faq-able! 1. How do you call a JavaScript method from .NET? 2. How do you call a JavaScript method that return a result? 3. How do you expose a .NET class to JavaScript? 4. "Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies. 5. Why does the Visual

Visual Studio is not letting me add CefSharpBrowserControl to a form via the designer

北慕城南 提交于 2019-12-14 03:27:40
问题 So I decided to try out the CefSharp extension, and what's the first thing I encounter? An error that doesn't let me use the add-on. This is ridiculously frustrating because I've done every single thing even the administrator or creator has said to do on any forum I've been on. I tried to just compile the source code on the CEFSharp's GitHub, but that didn't work. If I'm brutally honest, I think that they should just provide a pre-compiled .dll file or group of .dll files that you can just

Cefsharp didn't start on Client Machine?

浪子不回头ぞ 提交于 2019-12-14 01:12:13
问题 What to add with .net 4.5.1, Visual C++ 2012 Redistribution inorder to make cefsharp work on Client machine?. I installed both .net 4.5.1, Visual C++ 2012 Redistribution package and the dlls libcef.dll icudt.dll CefSharp.dll CefSharp.WinForms.dll are all present, the cefsharp form didn't open up. Its showing exception "Could not load file or assembly cefsharp.dll". I have tried installing Visual C++ 2008,2010,2012 versions too. But it still didn't show up. 回答1: If you have this same problem

CefSharp get screenshot of a page

佐手、 提交于 2019-12-13 13:34:30
问题 Is it possible to get screenshot of a web page using CefSharp ? I have found information about GetImage() method but it seems to be not supported anymore. Is there any other way? I need to get screenshots from off-screen browser so making screenshot of a screen with browser displayed is not a solution. 回答1: I've implemented this feature in a forked branch https://github.com/ivan-sam/CefSharp. This implementation depends on a another commit that fixes script evaluation bug https://github.com

Ways to get data from localhost port using CefSharp

拈花ヽ惹草 提交于 2019-12-13 08:49:59
问题 currently developing a .net C# application which is showing a web browser. But since visual studio web browser is still using ie7 and does not support quite lots of things, I plan to put in the CefSharp which is the Chromium. So, have you guys every try get some json data from a localhost server using CefSharp? I have tried two ways to get it but failed. For C# in Visual Studio, I fired the Chromium browser like this: var test = new CefSharp.WinForms.ChromiumWebBrowser(AppDomain.CurrentDomain

Unable to deploy CefSharp application

两盒软妹~` 提交于 2019-12-13 05:32:37
问题 I'm trying to run my CefSharp application on a separate computer other than my development machine, but I'm unable to. I built it in Release for the x64 platform, and moved the entire contents of the build folder over to my other computer. I tried running all the executables in the build folder, but none of them would work; when executed, they would not appear on screen, and after some time a window would open up with the generic "this program has stopped working" windows crash dialogue. I

Using CefSharp and a SchemeHandler how to create a Javascript File()

大憨熊 提交于 2019-12-13 04:21:57
问题 On a website I am automating with the help of Cefsharp I have the need to provide a javascript File.File(). The file I want to give it is locally saved and could be anything from pdfs to office documents or images. As far as CefSharp is concerned I have implemented a ISchemeHandlerFactory and ResourceHandler adding a test:// scheme and for example I have successfully added a JS file like this. var head = document.head; var script = document.createElement('script'); script.type = 'text