/// <summary> Bytes naar KB, MB, GB, TB eenheden intelligente conversie /// </summary> <param name="len"></param> /// <returns></returns> publieke statische string ConvertBytes(long len) { string[] groottes = { "Bytes", "KB", "MB", "GB", "TB" }; int orde = 0; terwijl (len >= 1024 && orde + 1 < maten. Lengte) //{ orde++; len = len / 1024; //} return String.Format("{0:0.##} {1}", len, sizes[order]); dubbele leng = Convert.ToDouble(len); string[] groottes = { "Bytes", "KB", "MB", "GB", "TB" }; int orde = 0; terwijl (leng >= 1024 && orde + 1 < grootte. Lengte) { orde++; leng = leng / 1024; } return String.Format("{0:0.##} {1}", leng, sizes[order]); } |