C# CookieContainer使用

阅读更多
...



public HttpWebResponse SendRequest(HttpWebRequest webRequest) {

  webRequest.CookieContainer = cookieContainer;



  HttpWebResponse httpWebResponse = (HttpWebResponse)webRequest.GetResponse();

    if (webRequest.HaveResponse) {

      foreach (Cookie cookie in httpWebResponse.Cookies) {

        cookieContainer.Add(cookie);
      }

你可能感兴趣的:(C# CookieContainer使用)