cefsharp设置cookie,CefSharp如何存储Cookie

cefsharp设置cookie,CefSharp如何存储CookieIcan’tgetcookiestosaveinCefSharp.HereiswhatItried:CefSettingssettings=newCefSettings();stringpath=Environment.GetFolderPath(Environment.SpecialFolder.Desktop);Cef.Initialize(newCefS…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

cefsharp设置cookie,CefSharp如何存储Cookie

I can’t get cookies to save in CefSharp.

Here is what I tried:

CefSettings settings = new CefSettings();

string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

Cef.Initialize(new CefSettings());

settings.RemoteDebuggingPort = 8088;

settings.CachePath = path;

I’m using the desktop just to test it but I tried others as well.

This is the solution others got but I can’t get it to work:

Set CefSettings.CachePath directory. Settings are passed to Cef.Initialize(). The answer was from here.

After the comments I have tried this:

In the Initialize part I put this

CefSettings settings = new CefSettings();

string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

settings.RemoteDebuggingPort = 8088;

settings.CachePath = path;

Cef.Initialize(new CefSettings());

and

private void Form1_Load(object sender, EventArgs e)

{

SearchBox.Text = “http://www.google.com/”;

chrome = new ChromiumWebBrowser(SearchBox.Text);

this.MainBrowser.Controls.Add(chrome);

chrome.Dock = DockStyle.Fill;

chrome.AddressChanged += Chrome_AddressChanged;

解决方案private void InitializeChromium()

{

CefSettings settings = new CefSettings();

string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

settings.RemoteDebuggingPort = 8080;

settings.CachePath = path;

//Initialize Cef with the provided settings

Cef.Initialize(settings);

//Create a browser component

chrome = new ChromiumWebBrowser(SearchBox.Text);

//Add he browser to the form

this.MainBrowser.Controls.Add(chrome);

//Make the browser fill the form

chrome.Dock = DockStyle.Fill;

}

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/191986.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • ireport(FusionChartsFree)

    ireport(FusionChartsFree)ireport(FusionChartsFree)留下脚印以备下次之需

    2022年7月14日
    19
  • 程序员接私活的平台(java接私活哪个网站好)

    这里分享一些程序员如何接私活的一些平台~开发邦:https://www.kaifabang.com/码易:https://www.mayigeek.com/开源众包:https://zb.oschina.net/人人开发:http://rrkf.com/程序员客栈:https://www.proginn.com/码市:https://codemart.com/快码众包:https:…

    2022年4月16日
    47
  • python从入门到精通——完整教程

    python从入门到精通——完整教程<linkrel=”stylesheet”href=”https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-1a85854398.css”><divid=”content_views”class=”htmledit_views”><p>&nbsp;</p>文章目录…

    2022年7月22日
    21
  • 解决微信小程序errcode:40029[通俗易懂]

    解决微信小程序errcode:40029[通俗易懂]第一次接触微信小程序,喜提errcode:40029errmsg:”invalidcode,hints:[req_id:6HfBbZyFe-8y]场景:写完接口之后前端联调一直500,最后发现是获取的时候微信报错了。解决办法:导入项目的时候appid要填入你请求session_key的appid,如图所示(我这个开发者工具是旧版的)还有一种解决方法是其他文章找…

    2022年5月24日
    352
  • 转换 datetime 和 smalldatetime 数据[通俗易懂]

    转换 datetime 和 smalldatetime 数据[通俗易懂]转换datetime和smalldatetime数据转换为datetime时,Microsoft®SQLServer™2000将拒绝所有无法识别为日期的值(包括1753年1月1日以前的日期)。当日期在适当的范围内(1900年1月1日到2079年6月6日)时,可将datetime值转换为smalldatetime。时间值被四舍五入

    2022年5月19日
    42
  • outsystems

    outsystemsoutsystems从入门到精通-朱家俊的文章-知乎https://zhuanlan.zhihu.com/p/322582052outsystemsoutsystemsoutsystemsoutsystemsoutsystemsoutsystems

    2022年10月22日
    0

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号