1、设置cookievar cookieManager = CefSharp.Cef.GetGlobalCookieManager();
await cookieManager.SetCookieAsync("http://" + domain, new CefSharp.Cookie()
{
Domain = domain,
Name = name,
Value = value,
Expires = DateTime.MinValue
});
2、读取cookie
1) 创建Cookie读取对象,继承接口 ICookieVisitorpublic class CookieVisitor : CefSharp.ICookieVisitor
{
public event Action SendCookie;
public bool Visit(CefSharp.Cookie cookie, int count, int total, ref bool deleteCookie)
{
deleteCookie = false;
if (SendCookie != null)
{
SendCookie(cookie);
}
return true;
}
}
2) 在browser事件中进行处理private void browser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e)
{
var cookieM