private string BytesToString(long bytes)
{
string[] sizes = { "B", "KB", "MB", "GB" };
double len = bytes;
int order = 0;
while (len >= 1024 && order + 1 < sizes.Length)
{
order++;
len = len / 1024;
}
return string.Format("{0:0.##} {1}", len, sizes[order]);
}