title: How can i get a file name from Response.Header ? C#
body: <p>This is a code,  C#.</p>
  
  <pre><code>System.Net.HttpWebRequest _Response =
      (HttpWebRequest)System.Net.WebRequest.Create(e.Uri.AbsoluteUri.ToString());
  _Response.Method = "GET";
  _Response.Timeout = 120000;
  _Response.Accept =
      "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
  _Response.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
  _Response.Headers.Add("Accept-Language", "ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4");
  _Response.Headers.Add("Accept-Charset", "windows-1251,utf-8;q=0.7,*;q=0.3");
  _Response.AllowAutoRedirect = false;
  
  System.Net.HttpWebResponse result = (HttpWebResponse)_Response.GetResponse();
  
  for (int i = 0; i &lt; result.Headers.Count; i++)
  {
      MessageBox.Show(result.Headers.ToString());
  }
  </code></pre>
  
  <p>And this is a result,</p>
  
  <pre><code>Cache-Control: private
  Content-Type: text/html
  Date: Tue, 06 Sep 2011 17:38:26 GMT
  ETag: 
  Location: http://fs31.filehippo.com/6428/59e79d1f80a74ead98bb04517e26b730/Firefox Setup 7.0b3.exe
  Server: Microsoft-IIS/6.0
  X-Powered-By: ASP.NET
  </code></pre>