title: Accept Cookies in WebClient?
body: <p>I just started experimenting with C# <code>WebClient</code>. What I have is the code below which gets html code from a website and writes it in a .txt file. The only problem I have is that some websites require you to accept cookies before you can use the website. What this causes is instead of writing the real website html code to the .txt file, it writes the cookie popup html code.</p>
  <p>Code:</p>
  <pre><code>string downloadedString;
  System.Net.WebClient client;
  
  client = new System.Net.WebClient();
   
  //&quot;http://nl.wikipedia.org/wiki/Lijst_van_spelers_van_het_Nederlands_voetbalelftal&quot;
  downloadedString = client.DownloadString(textBox1.Text);
  
  using (StreamWriter write = new StreamWriter(&quot;Data.txt&quot;))
  {
      write.Write(downloadedString);
  }
  </code></pre>
  <p>So what is the solution to this? Can somebody direct me to the right path?</p>