Table of Contents

Class FileSizesExtensions

Namespace
Ecng.Common
Assembly
Ecng.Common.dll

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

public static class FileSizesExtensions
Inheritance
FileSizesExtensions
Inherited Members

Methods

FromKB(long)

Converts the specified number of kilobytes to bytes.

public static long FromKB(this long kbytes)

Parameters

kbytes long

The number of kilobytes.

Returns

long

The equivalent number of bytes.

FromMB(long)

Converts the specified number of megabytes to bytes.

public static long FromMB(this long mbytes)

Parameters

mbytes long

The number of megabytes.

Returns

long

The equivalent number of bytes.

ToKB(long)

Converts the specified number of bytes to kilobytes.

public static long ToKB(this long bytes)

Parameters

bytes long

The number of bytes.

Returns

long

The equivalent number of kilobytes.

ToMB(long)

Converts the specified number of bytes to megabytes.

public static long ToMB(this long bytes)

Parameters

bytes long

The number of bytes.

Returns

long

The equivalent number of megabytes.