Export (0) Print
Expand All

UInt64Converter Class

Provides a type converter to convert 64-bit unsigned integer objects to and from other representations.

For a list of all members of this type, see UInt64Converter Members.

System.Object
   System.ComponentModel.TypeConverter
      System.ComponentModel.BaseNumberConverter
         System.ComponentModel.UInt64Converter

[Visual Basic]
Public Class UInt64Converter
   Inherits BaseNumberConverter
[C#]
public class UInt64Converter : BaseNumberConverter
[C++]
public __gc class UInt64Converter : public BaseNumberConverter
[JScript]
public class UInt64Converter extends BaseNumberConverter

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

This converter can only convert a 64-bit unsigned integer object to and from a string.

The UInt64 value type represents unsigned integers with values ranging from 0 to 184,467,440,737,095,551,615. This data type is not supported in Visual Basic.

Note   You should never create an instance of a UInt64Converter. Instead, call the GetConverter method of TypeDescriptor. For more information, see the examples in the TypeConverter base class and Implementing a Type Converter.

Example

[Visual Basic, C#, C++] The following example converts a variable of type UInt64 to a string, and vice versa.

[Visual Basic] 
'This data type is not supported in Visual Basic.
    . . . 
'This data type is not supported in Visual Basic.

[C#] 
ulong myUInt64 = 123456789123;
string myUInt64String = "184467440737095551";
Console.WriteLine(TypeDescriptor.GetConverter(myUInt64).ConvertTo(myUInt64, typeof(string))); 
Console.WriteLine(TypeDescriptor.GetConverter(myUInt64).ConvertFrom(myUInt64String));    
    . . . 
ulong myUInt64 = 123456789123;
string myUInt64String = "184467440737095551";
Console.WriteLine(TypeDescriptor.GetConverter(myUInt64).ConvertTo(myUInt64, typeof(string))); 
Console.WriteLine(TypeDescriptor.GetConverter(myUInt64).ConvertFrom(myUInt64String));    

[C++] 
UInt64 myUInt64( 123456789123 );
String* myUInt64String = S"184467440737095551";
Console::WriteLine(TypeDescriptor::GetConverter(__box(myUInt64))->ConvertTo(__box(myUInt64), __typeof(String)));
Console::WriteLine(TypeDescriptor::GetConverter(__box(myUInt64))->ConvertFrom(myUInt64String));
    . . . 
UInt64 myUInt64( 123456789123 );
String* myUInt64String = S"184467440737095551";
Console::WriteLine(TypeDescriptor::GetConverter(__box(myUInt64))->ConvertTo(__box(myUInt64), __typeof(String)));
Console::WriteLine(TypeDescriptor::GetConverter(__box(myUInt64))->ConvertFrom(myUInt64String));

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.ComponentModel

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

Assembly: System (in System.dll)

See Also

UInt64Converter Members | System.ComponentModel Namespace

Show:
© 2014 Microsoft