首页 > 代码库 > C# login with cookie and fiddler2

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();

C# login with cookie and fiddler2