FileSizesExtensions

Ecng.Common

Provides extension methods for converting file sizes between bytes, kilobytes, and megabytes.

メソッド

FromKB
public static long FromKB(long kbytes)
result = FileSizesExtensions.FromKB(kbytes)

Converts the specified number of kilobytes to bytes.

kbytes
The number of kilobytes.

戻り値: The equivalent number of bytes.

FromMB
public static long FromMB(long mbytes)
result = FileSizesExtensions.FromMB(mbytes)

Converts the specified number of megabytes to bytes.

mbytes
The number of megabytes.

戻り値: The equivalent number of bytes.

ToHumanReadableFileSize
public static string ToHumanReadableFileSize(long byteCount)
result = FileSizesExtensions.ToHumanReadableFileSize(byteCount)

Converts a byte count to a human-readable file size string.

byteCount
The number of bytes.

戻り値: A formatted string representing the file size.

ToKB
public static long ToKB(long bytes)
result = FileSizesExtensions.ToKB(bytes)

Converts the specified number of bytes to kilobytes.

bytes
The number of bytes.

戻り値: The equivalent number of kilobytes.

ToMB
public static long ToMB(long bytes)
result = FileSizesExtensions.ToMB(bytes)

Converts the specified number of bytes to megabytes.

bytes
The number of bytes.

戻り値: The equivalent number of megabytes.