OptionConverter ToFileSize Method | Apache log4net™ SDK Documentation

Parses a file size into a number.

Namespace: log4net.Util
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public static long ToFileSize(
    	string argValue,
    	long defaultValue
    )

    Public Shared Function ToFileSize (
    	argValue As String,
    	defaultValue As Long
    ) As Long

    public:
    static long long ToFileSize(
    	String^ argValue,
    	long long defaultValue
    )

    static member ToFileSize :
            argValue : string *
            defaultValue : int64 -> int64

#### Parameters

argValue
  Type: System
  String
  String to parse.
defaultValue
  Type: System
  Int64
  The default value.

#### Return Value

Type: Int64
The Int64 value of argValue.
Remarks

Parses a file size of the form: number[KB|MB|GB] into a long value. It is scaled with the appropriate multiplier.

defaultValue is returned when argValue cannot be converted to a Int64 value.

See Also

#### Reference

OptionConverter Class
log4net.Util Namespace