title: How can I get the name of a HttpResponseHeader?
body: <p>I am able to loop through a response.Headers collection and display the value for each header like this. </p>
  
  <pre><code>HttpWebRequest req = (HttpWebRequest)WebRequest.Create(postDest);
  //Set up the request with needed properties etc.
  HttpWebResponse response = req.GetResponse() as HttpWebResponse;    
  for(int i= 0; i &lt; response.Headers.Count; i++)
  {
        MessageBox.Show(response.Headers[i].ToString());
  }
  </code></pre>
  
  <p>But how can I get the name Field-Name for each ResponseHeader?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>If I do this I am able to get the Field-Name and the Value.</p>
  
  <pre><code>    for (int i = 0; i &lt; response.Headers.Count; i++)
      {
          MessageBox.Show("Field-Name is: " + response.Headers.GetKey(i).ToString() + " Value is: " + response.Headers[i].ToString());
      }
  </code></pre>