This documentation is archived and is not being maintained.

Convert.ToUInt64 Method (String, Int32)

.NET Framework 1.1

Converts the String representation of a number in a specified base to an equivalent 64-bit unsigned integer.

This method is not CLS-compliant. For more information about CLS compliance, see What is the Common Language Specification.

[Visual Basic]
Overloads Public Shared Function ToUInt64( _
   ByVal value As String, _
   ByVal fromBase As Integer _
) As UInt64
public static ulong ToUInt64(
 string value,
 int fromBase
public: static unsigned __int64 ToUInt64(
 String* value,
 int fromBase
static function ToUInt64(
 value : String,
 fromBase : int
) : UInt64;


A String containing a number.
The base of the number in value, which must be 2, 8, 10, or 16.

Return Value

A 64-bit unsigned integer equivalent to the number in value.


Zero if value is a null reference (Nothing in Visual Basic).


Exception Type Condition
ArgumentException fromBase is not 2, 8, 10, or 16.


If fromBase is 16, you can prefix the number specified by the value parameter with "0x" or "0X".


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

Convert Class | Convert Members | System Namespace | Convert.ToUInt64 Overload List