Another thought is that you might be able to add cookies via JavaScript. You should be able to do this (provided IsScriptEnabled is true on your browser control):
private void setCookie(string name, string value, string path = "", string domain = "", bool isSecure=false, string expires = "")
{
var sb = new StringBuilder();
sb.AppendFormat("document.cookie = '{0}=" + escape("{1}")", name, value);
if (!String.IsNullOrEmpty(expires))
sb.AppendFormat(";expires="{0}"", expires); // should be a GMTString
if (!String.IsNullOrEmpty(path))
sb.AppendFormat(";path="{0}"", path);
if (!String.IsNullOrEmpty(domain))
sb.AppendFormat(";domain="{0}"", domain);
if (isSecure)
sb.Append(";secure'");
var cookieJs = sb.ToString();
Debug.WriteLine(cookieJs);
webBrowser.InvokeScript(cookieJs);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…