如何让webbrowser控件支持Html5
1个回答
2017-11-02 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
关注
展开全部
代码如下:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Xilium.CefGlue; namespace Xilium.CefGlue.WindowsForms{ public class BsLifeSpanHandler : CefLifeSpanHandler { private CefWebClient bClient; public BsLifeSpanHandler(CefWebClient bc) { bClient = bc; } protected override void OnAfterCreated(Xilium.CefGlue.CefBrowser browser) { base.OnAfterCreated(browser); bClient.Created(browser); } }}
然后打开CefWebClient.cs文件,添加声明
1
private readonly CefDownloadHandler downloadHandler;
在构造函数中加入
1
downloadHandler = new BsDownloadHandler();
然后添加一个方法名在文档末尾
protected override CefDownloadHandler GetDownloadHandler() { return downloadHandler; }
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Xilium.CefGlue; namespace Xilium.CefGlue.WindowsForms{ public class BsLifeSpanHandler : CefLifeSpanHandler { private CefWebClient bClient; public BsLifeSpanHandler(CefWebClient bc) { bClient = bc; } protected override void OnAfterCreated(Xilium.CefGlue.CefBrowser browser) { base.OnAfterCreated(browser); bClient.Created(browser); } }}
然后打开CefWebClient.cs文件,添加声明
1
private readonly CefDownloadHandler downloadHandler;
在构造函数中加入
1
downloadHandler = new BsDownloadHandler();
然后添加一个方法名在文档末尾
protected override CefDownloadHandler GetDownloadHandler() { return downloadHandler; }
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询