title: C# Download Image from unknown format
body: <p>I'm working on batch downloader but some URLs are not sending data correctly.</p>
  
  <p>For example, this page: <a href="http://i.imgbox.com/absMQK6A.png" rel="nofollow">http://i.imgbox.com/absMQK6A.png</a></p>
  
  <p>In any internet browser, this page shows an image, but in my program, downloads strange data.
  I think this URL is fake or protected (I don't know HTML well.)</p>
  
  <p>BTW, in IE, I can download that image normally with right click and save as image.
  so I want to emulate that behavior in my program.</p>
  
  <p>How can I do this?</p>
  
  <p>Below is part of my program's code.</p>
  
  <pre><code>HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(DownloadAddress);
  if (Proxy != null)
  {
      request.Proxy = Proxy;
  }
  if (!string.IsNullOrWhiteSpace(UserAgent))
  {
      request.UserAgent = UserAgent;
  }
  
  HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  Stream downloadHttpStream = response.GetResponseStream();
  int read = downloadHttpStream.Read(buffer, 0, buffer.Length);
  // output codes
  </code></pre>
  
  <p>UserAgent is string that has informations of browser.
  such as IE, Firefox etc.</p>
  
  <p>Thanks.</p>