Well This questions as far I was searching never been asked before...
I'm trying to extract a cookie value from my webbrowser control I wasn't been able to find any helpful information I want to extract the cookies values after webbrowser navigate:
private void Form1_Load(object sender, EventArgs e)
{
webBrowser1.Navigate("http://site.com");
}
I have a nice code for regex find for httpwebreqest something similar to webbrowser control is what I'm trying to do:
List<string> cookieValues = new List<string>();
foreach (Cookie cookie in agent.LastResponse.Cookies)
{
cookieValues.Add(cookie.Value);
}
foreach (string i in cookieValues)
{
Match match2 = Regex.Match(i, @"bert=([\w]*)",
RegexOptions.IgnoreCase);
// Ensure match
if (match2.Success)
{
// Finally, we get Group value and display it.
key2 = match2.Groups[1].Value;
}
Honestly I didn't play with webbrowser so I got no clue where to start. Got any ideas? From what I been researching it's possible Webbrowser control are the same cookies in IE?