Converts a String to an Int64 in the specified base.
[Visual Basic] Overloads Public Shared Function ToInt64( _ ByVal value As String, _ ByVal fromBase As Integer _ ) As Long [C#] public static long ToInt64( string value, int fromBase ); [C++] public: static __int64 ToInt64( String* value, int fromBase ); [JScript] public static function ToInt64( value : String, fromBase : int ) : long;
The Int64 representation of value as a base base .
Exception Type | Condition |
---|---|
ArgumentException | fromBase is not 2, 8, 10, or 16. |
FormatException | value cannot be parsed as a base fromBase number. |
ArgumentNullException | value is null. |
OverflowException | The value represented by value is greater than Int64.MaxValue or less than Int64.MinValue. |
A fromBase value can be only 2, 8, 10, or 16. If fromBase is 16, the number may be preceded by "0x"; any other leading or trailing characters cause an error.
Convert Class | Convert Members | System Namespace | Convert.ToInt64 Overload List