C# login with cookie and fiddler2

http://blog.codeblack.nl/post/HttpWebRequest-HttpWebResponse-and-cookies.aspx

 

CookieContainer cookieContainer = new CookieContainer();
 
HttpWebRequest firstRequest = (HttpWebRequest)HttpWebRequest.Create(url);
request.CookieContainer = cookieContainer;
 
HttpWebResponse firstResponse = (HttpWebResponse)firstRequest.GetResponse();
 
HttpWebRequest secondRequest = (HttpWebRequest)HttpWebRequest.Create(url);
request.CookieContainer = cookieContainer;
 
HttpWebResponse secondResponse = (HttpWebResponse)secondRequest .GetResponse();
posted @ 2014-11-04 16:19  webglcn  阅读(180)  评论(0编辑  收藏  举报