foreach KeyValuePair in NameValueCollection?
<p>I have this code:</p>

<pre><code>NameValueCollection nv = HttpUtility.ParseQueryString(queryString);        
foreach (KeyValuePair&lt;String,String&gt; pr in nv) {
    //process KeyValuePair          
}
</code></pre>

<p>This compiles, but when I try to run it I get an <code>InvalidCastException</code>.</p>

<p>Why is this? Why can't I use <code>KeyValuePair</code> to iterate over a <code>NameValueCollection</code>, and what should I use instead?</p>
