Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

bytes size c#

public static string GetSizeInMemory(this long bytesize)
{


    string[] sizes = { "B", "KB", "MB", "GB", "TB" };
    double len = Convert.ToDouble(bytesize);
    int order = 0;
    while(len >= 1024D && order < sizes.Length - 1)
    {
        order++;
        len /= 1024;
    }

    return string.Format(CultureInfo.CurrentCulture,"{0:0.##} {1}", len, sizes[order]);
}
Comment

bytes size c#


  System.Text.ASCIIEncoding.Unicode.GetByteCount(string);
  System.Text.ASCIIEncoding.ASCII.GetByteCount(string);

Comment

PREVIOUS NEXT
Code Example
Csharp :: c# tuple 
Csharp :: c# get string in parentheses 
Csharp :: winforms input box 
Csharp :: exceeds your upload_max_filesize ini directive (limit is 2048 KiB). 
Csharp :: registry keys and values 
Csharp :: C# program lambda Func 
Csharp :: Code to disable Debug.log 
Csharp :: c# import class from another file 
Csharp :: count the number of notes in a given amount c# 
Csharp :: c# map function 
Csharp :: entity framework with query C# 
Csharp :: asp.net core authorization default policy 
Csharp :: c# $ string 
Csharp :: get index brushes properties c# 
Csharp :: unity scene switch 
Csharp :: go right unity 
Csharp :: monogame delta 
Csharp :: Make UI/Canvas look at Camera always. 
Csharp :: Send Hotmail/Outlook Email C# (Win/ASP.NET) 
Csharp :: get script directory c# 
Csharp :: c# remove xml invalid characters 
Csharp :: Getting the text from a drop-down box 
Csharp :: Block iFrames | How to Stop Your Website From Being iFramed 
Csharp :: unity2d switch camera 
Csharp :: unity stop object from rotating 
Csharp :: How to change ListBox selection background color 
Csharp :: c# winforms datagridview bind to list 
Csharp :: create list of strings from field of list of object c# 
Csharp :: asp.net core update-database specify environment 
Csharp :: c# convert xml to list string 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =