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 :: attribute decorator to require email format of string c# 
Csharp :: auto paly a video control in mvc c# 
Csharp :: tulpep notification window example c# 
Csharp :: c# properties making string required 
Csharp :: Package manager or PM cmd for dbcontext migration 
Csharp :: how to make a respaen script in unity 
Csharp :: change character velocity unity 
Csharp :: invalid length for a base-64 char array or string. frombase64string c# 
Csharp :: how to get the screen size in Tao.Freeglut 
Csharp :: C# Check if variables are equal 
Csharp :: Unity PlayOneShoot Audio 
Csharp :: hdrp lit change emmision values 
Csharp :: ddsfsd 
Csharp :: compass direction mobile unity 
Csharp :: get current culture in controller asp.net core 6 
Csharp :: unity use of possibly unassigned field struct 
Csharp :: how to colapse all methods visual studio 
Csharp :: Write N lines with M numbers each that describe the layout of the second layer in the way shown above 
Csharp :: client = matrice[indexselectedclient] as String[]; 
Csharp :: displaying list in gameobject Unity 
Csharp :: how to validate decimal number with percision of (25, 4) iin c# 
Csharp :: obs mfplat.dll 
Csharp :: windows 10 see how long a program has been running 
Csharp :: windows form toolbox enter key 
Csharp :: length of arr c# 
Csharp :: dotnet core webapp 
Csharp :: Create an array with random values c# 
Csharp :: how to get the index of an element in a list in unity 5 
Csharp :: keyboard hook c# 
Csharp :: come controllare se textbox è vuota c# 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =