ASP.NET/C# - Detect File Size from Other Server?
<p>I'm trying to find the file size of a file on a server. The following code I got from <a href="http://www.thejackol.com/2005/06/11/aspnet-get-file-size/" rel="nofollow">this guy</a> accomplishes that for your own server:</p>

<pre><code>string MyFile = "~/photos/mymug.gif";

FileInfo finfo = new FileInfo(Server.MapPath(MyFile));
long FileInBytes = finfo.Length;
long FileInKB = finfo.Length / 1024;

Response.Write("File Size: " + FileInBytes.ToString() + 
  " bytes (" + FileInKB.ToString() + " KB)");
</code></pre>

<p>It works. However, I want to find the filesize of, for example:</p>

<pre><code>string MyFile = "http://www.google.com/intl/en_ALL/images/logo.gif";

FileInfo finfo = new FileInfo(MyFile);
</code></pre>

<p>Then I get a pesky error saying <code>URI formats are not supported.</code></p>

<p>How can I find the file size of Google's logo with ASP.NET?</p>
