diff --git a/Netch/Utils/Bandwidth.cs b/Netch/Utils/Bandwidth.cs index 72c68234..6c809080 100644 --- a/Netch/Utils/Bandwidth.cs +++ b/Netch/Utils/Bandwidth.cs @@ -21,26 +21,7 @@ namespace Netch.Utils /// /// 流量 /// 带单位的流量字符串 - public static string Compute(long bandwidth) - { - string[] units = {"KB", "MB", "GB", "TB", "PB"}; - double result = bandwidth; - var i = -1; - - do - { - i++; - } while ((result /= 1024) > 1024); - - if (result < 0) - { - result = 0; - } - - return string.Format("{0} {1}", Math.Round(result, 2), units[i]); - } - - public static string ToByteSize(long size) + public static string Compute(long size) { var mStrSize = @"0"; const double step = 1024.00;