Download a file from C# after posting valid data
<p>I want users of my c# application to be able to download a file from my website if they provide certain details.</p>

<p>I can download the file using in c# using:</p>

<pre><code>WebClient webClient = new WebClient();
webClient.DownloadFile("http://www.example.com/download.php", "file.txt");
</code></pre>

<p>And I can upload values using webClient.UploadValues method, but I don't know how to combine them. That is, to download the file and posting data at the same time.</p>

<p>The download.php file contains the following:
    

<pre><code>$file = 'file.png';
if ((file_exists($file)) and ($_POST["ID"] == 'abc') ) {
    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename='.basename($file));
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: must-revalidate');
    header('Pragma: public');
    header('Content-Length: ' . filesize($file));
    ob_clean();
    flush();
    readfile($file);
    exit;
}
else
header('HTTP/1.0 404 Not Found');
}
?&gt;
</code></pre>

<p>How should I post the data from C# and then download the file?</p>
