Finding size of a directory
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/468119/whats-the-best-way-to-calculate-the-size-of-a-directory-in-net">What’s the best way to calculate the size of a directory in .NET?</a>  </p>
</blockquote>



<p>By this I mean how much memory space, in gigabytes or megabytes, a directory contains. There has been much uncertainty for this, just a few lines of code will do. I tried using this: </p>

<pre><code>string[] SubFolderFiles = Directory.GetFiles(DirectoryLocation, "*.*", 
                                             SearchOption.AllDirectories);

foreach (string file in SubFolderFiles)
{
    AmountOfSpace += file.Length;
}

AmountOfSpaceInGigabytes = dropdoublefreespace / 1073741824;
</code></pre>

<p>I found that there are roughly 1073741824 characters in a gigabyte, but this is not accurate. Im not looking to make an operating system or anything as you could probably tell, so something simple would be nice. Any help would be appreciated, I will give a green check mark to the one who solves this problem and +1 them.</p>
