Private void GetCookie ()/login/take cookies
{
MyCookieContainer=new CookieContainer ();
Login//take webBrowser1 cookies information:
//String type of cookies to switch to a Cookie and into the CookieContainer
String cookieStr=webBrowser1. Document. Cookies;
String [] cookstr=cookieStr. Split ('; ');
To remove the cookies//traversal and construct new cookies information
The foreach (string STR in cookstr)
{
String [] cookieNameValue=https://bbs.csdn.net/topics/str.Split ('=');
Cookie ck=new Cookie (cookieNameValue [0]. The Trim (), ToString (), cookieNameValue [1]. The Trim (), ToString ());
Ck. Domain=https://* * *. Com: "8180";//cookies information domain name
MyCookieContainer. Add (ck);
}
}
CodePudding user response:
Based on security considerations, HTTPS adds some limitations, after the test the switch to HTTPS, can use the browser to download?