title: Set Cookies To WebClient c#
body: <p>i have tried all thing and didn't  download page with cookie !</p>
  
  <p>i was success get cookie </p>
  
  <p>but i am don't success to set it into the downloading with cookie</p>
  
  <p>i am using WebClient.. </p>
  
  <p>any Solutions?</p>
  
  <p>my code :</p>
  
  <pre><code>foreach (Cookie cook in response.Cookies)
   {
  
     string name =cook.Name;
      string val = cook.Value;
  
  
         if (i == 0) { coock = cook.Name + "=" + val; } else { coock = coock + "; " + cook.Name + "=" + val; }
  
       i++;
  
   }
  
  
     WebClient client = new WebClient(); 
  
    client.Headers.Add(HttpRequestHeader.Cookie, coock);
  
     client.Headers.Add("Content-Type: application/x-www-form-urlencoded");
     client.Headers.Add("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5");
    client.Headers.Add("Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
    client.Headers.Add("Accept-Encoding: identity");
    client.Headers.Add("Accept-Language: en-US,en;q=0.8");
    client.Headers.Add("Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3");
  
    try
    {
    string respons2e = client.DownloadString("http://m.facebook.com");
    }catch{}
  </code></pre>
  
  <p>// this is don't duplicate i was tried all Solutions.. </p>