title: c# Download File from URL - not working
body: <p>Im trying to get my C# program to download a file from an address (<a href="http://example.com/test.txt" rel="nofollow">http://example.com/test.txt</a>, obvs this isn't the real address)</p>
  
  <p>I setup the Webclient and use DownloadFile() as shown:</p>
  
  <pre><code>WebClient client = new WebClient();
  string filename =  @"C:\test_dwl.txt";
  client.DownloadFile("http://example.com/test.txt", filename);
  </code></pre>
  
  <p>I know what the test.txt file should contain. However after I run my c# code, and then open the C:\test_dwl.txt it doesn't contain the expected data.</p>
  
  <p>It just says:</p>
  
  <p><strong><em>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</em></strong></p>
  
  <p>What confuses me is why it is mentioning Javascript?? I'm sure the file can be downloaded directly. If I enter the address directly into chrome (<a href="http://example.com/test.txt" rel="nofollow">http://example.com/test.txt</a>) - it downloads the correct file.</p>
  
  <p>Am I doing something wrong here? Or do I need to use a different method in C# to download these files.</p>
  
  <p>Thanks</p>
  
  <p>EDIT: this is what chrome dev tools show</p>
  
  <pre><code>&lt;html&gt;&lt;body&gt;&lt;script type="text/javascript" src="/aes.js" &gt;&lt;/script&gt;&lt;script&gt;function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&amp;&amp;arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f&lt;d.length;f++)e+=(16&gt;d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("e99c963ef2ec3e7d2f9e25eb2b02827b");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; document.cookie="referrer="+escape(document.referrer); location.href="http://example.com/test.txt?ckattempt=1";&lt;/script&gt;&lt;noscript&gt;This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support&lt;/noscript&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>How can I use this in c#??</p>