C#: Remote Image size without downloading it
<p>I have an image's URL. Is it possible to find out its size(in bytes) and dimensions without downloading the complete image?</p>

<p><strong>EDIT</strong></p>

<pre><code>HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "HEAD";
HttpWebResponse resp = (HttpWebResponse)(req.GetResponse());
System.Console.WriteLine(resp.ContentLength);
</code></pre>

<p>I have written this code. It works fine for first two time and the third time it gives <code>WebException</code> i.e. "operation timed out" irrespective of the image url. Is there something that I am missing here?</p>
