3 out of 6 rated this helpful - Rate this topic

Convert Class

Converts a base data type to another base data type.

System.Object
  System.Convert

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
public static class Convert

The Convert type exposes the following members.

  Name Description
Public method Static member ChangeType(Object, Type) Returns an object of the specified type and whose value is equivalent to the specified object.
Public method Static member ChangeType(Object, TypeCode) Returns an object of the specified type whose value is equivalent to the specified object.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ChangeType(Object, Type, IFormatProvider) Returns an object of the specified type whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information.
Public method Static member Supported by the XNA Framework ChangeType(Object, TypeCode, IFormatProvider) Returns an object of the specified type whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library FromBase64CharArray Converts a subset of a Unicode character array, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array. Parameters specify the subset in the input array and the number of elements to convert.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library FromBase64String Converts the specified string, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array.
Public method Static member Supported by the XNA Framework GetTypeCode Returns the TypeCode for the specified object.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library IsDBNull Returns an indication whether the specified object is of type DBNull.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBase64CharArray(Byte[], Int32, Int32, Char[], Int32) Converts a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character array encoded with base-64 digits. Parameters specify the subsets as offsets in the input and output arrays, and the number of elements in the input array to convert.
Public method Static member ToBase64CharArray(Byte[], Int32, Int32, Char[], Int32, Base64FormattingOptions) Converts a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character array encoded with base-64 digits. Parameters specify the subsets as offsets in the input and output arrays, the number of elements in the input array to convert, and whether line breaks are inserted in the output array.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBase64String(Byte[]) Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits.
Public method Static member ToBase64String(Byte[], Base64FormattingOptions) Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. A parameter specifies whether to insert line breaks in the return value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBase64String(Byte[], Int32, Int32) Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. Parameters specify the subset as an offset in the input array, and the number of elements in the array to convert.
Public method Static member ToBase64String(Byte[], Int32, Int32, Base64FormattingOptions) Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. Parameters specify the subset as an offset in the input array, the number of elements in the array to convert, and whether to insert line breaks in the return value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Boolean) Returns the specified Boolean value; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Byte) Converts the value of the specified 8-bit unsigned integer to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Char) Calling this method always throws InvalidCastException.
Public method Static member ToBoolean(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Decimal) Converts the value of the specified decimal number to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Double) Converts the value of the specified double-precision floating-point number to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Int16) Converts the value of the specified 16-bit signed integer to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Int32) Converts the value of the specified 32-bit signed integer to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Int64) Converts the value of the specified 64-bit signed integer to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Object) Converts the value of a specified object to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(SByte) Converts the value of the specified 8-bit signed integer to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Single) Converts the value of the specified single-precision floating-point number to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(String) Converts the specified string representation of a logical value to its Boolean equivalent.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(UInt16) Converts the value of the specified 16-bit unsigned integer to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent Boolean value.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(Object, IFormatProvider) Converts the value of the specified object to an equivalent Boolean value, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToBoolean(String, IFormatProvider) Converts the specified string representation of a logical value to its Boolean equivalent, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Boolean) Converts the specified Boolean value to the equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Byte) Returns the specified 8-bit unsigned integer; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Char) Converts the value of the specified Unicode character to the equivalent 8-bit unsigned integer.
Public method Static member ToByte(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Decimal) Converts the value of the specified decimal number to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Double) Converts the value of the specified double-precision floating-point number to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Int16) Converts the value of the specified 16-bit signed integer to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Int32) Converts the value of the specified 32-bit signed integer to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Int64) Converts the value of the specified 64-bit signed integer to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Object) Converts the value of the specified object to an 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(SByte) Converts the value of the specified 8-bit signed integer to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Single) Converts the value of the specified single-precision floating-point number to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(String) Converts the specified string representation of a number to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(UInt16) Converts the value of the specified 16-bit unsigned integer to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent 8-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(Object, IFormatProvider) Converts the value of the specified object to an 8-bit unsigned integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(String, IFormatProvider) Converts the specified string representation of a number to an equivalent 8-bit unsigned integer, using specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToByte(String, Int32) Converts the string representation of a number in a specified base to an equivalent 8-bit unsigned integer.
Public method Static member ToChar(Boolean) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(Byte) Converts the value of the specified 8-bit unsigned integer to its equivalent Unicode character.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(Char) Returns the specified Unicode character value; no actual conversion is performed.
Public method Static member ToChar(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(Decimal) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(Double) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(Int16) Converts the value of the specified 16-bit signed integer to its equivalent Unicode character.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(Int32) Converts the value of the specified 32-bit signed integer to its equivalent Unicode character.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(Int64) Converts the value of the specified 64-bit signed integer to its equivalent Unicode character.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(Object) Converts the value of the specified object to a Unicode character.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(SByte) Converts the value of the specified 8-bit signed integer to its equivalent Unicode character.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(Single) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(String) Converts the first character of a specified string to a Unicode character.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(UInt16) Converts the value of the specified 16-bit unsigned integer to its equivalent Unicode character.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(UInt32) Converts the value of the specified 32-bit unsigned integer to its equivalent Unicode character.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(UInt64) Converts the value of the specified 64-bit unsigned integer to its equivalent Unicode character.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(Object, IFormatProvider) Converts the value of the specified object to its equivalent Unicode character, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToChar(String, IFormatProvider) Converts the first character of a specified string to a Unicode character, using specified culture-specific formatting information.
Public method Static member ToDateTime(Boolean) Calling this method always throws InvalidCastException.
Public method Static member ToDateTime(Byte) Calling this method always throws InvalidCastException.
Public method Static member ToDateTime(Char) Calling this method always throws InvalidCastException.
Public method Static member ToDateTime(DateTime) Returns the specified DateTime object; no actual conversion is performed.
Public method Static member ToDateTime(Decimal) Calling this method always throws InvalidCastException.
Public method Static member ToDateTime(Double) Calling this method always throws InvalidCastException.
Public method Static member ToDateTime(Int16) Calling this method always throws InvalidCastException.
Public method Static member ToDateTime(Int32) Calling this method always throws InvalidCastException.
Public method Static member ToDateTime(Int64) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDateTime(Object) Converts the value of the specified object to a DateTime object.
Public method Static member ToDateTime(SByte) Calling this method always throws InvalidCastException.
Public method Static member ToDateTime(Single) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDateTime(String) Converts the specified string representation of a date and time to an equivalent date and time value.
Public method Static member ToDateTime(UInt16) Calling this method always throws InvalidCastException.
Public method Static member ToDateTime(UInt32) Calling this method always throws InvalidCastException.
Public method Static member ToDateTime(UInt64) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDateTime(Object, IFormatProvider) Converts the value of the specified object to a DateTime object, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDateTime(String, IFormatProvider) Converts the specified string representation of a number to an equivalent date and time, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Boolean) Converts the specified Boolean value to the equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Byte) Converts the value of the specified 8-bit unsigned integer to the equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Char) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Decimal) Returns the specified decimal number; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Double) Converts the value of the specified double-precision floating-point number to an equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Int16) Converts the value of the specified 16-bit signed integer to an equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Int32) Converts the value of the specified 32-bit signed integer to an equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Int64) Converts the value of the specified 64-bit signed integer to an equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Object) Converts the value of the specified object to an equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(SByte) Converts the value of the specified 8-bit signed integer to the equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Single) Converts the value of the specified single-precision floating-point number to the equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(String) Converts the specified string representation of a number to an equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(UInt16) Converts the value of the specified 16-bit unsigned integer to an equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent decimal number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(Object, IFormatProvider) Converts the value of the specified object to an equivalent decimal number, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDecimal(String, IFormatProvider) Converts the specified string representation of a number to an equivalent decimal number, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Boolean) Converts the specified Boolean value to the equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Byte) Converts the value of the specified 8-bit unsigned integer to the equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Char) Calling this method always throws InvalidCastException.
Public method Static member ToDouble(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Decimal) Converts the value of the specified decimal number to an equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Double) Returns the specified double-precision floating-point number; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Int16) Converts the value of the specified 16-bit signed integer to an equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Int32) Converts the value of the specified 32-bit signed integer to an equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Int64) Converts the value of the specified 64-bit signed integer to an equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Object) Converts the value of the specified object to a double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(SByte) Converts the value of the specified 8-bit signed integer to the equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Single) Converts the value of the specified single-precision floating-point number to an equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(String) Converts the specified string representation of a number to an equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(UInt16) Converts the value of the specified 16-bit unsigned integer to the equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent double-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(Object, IFormatProvider) Converts the value of the specified object to an double-precision floating-point number, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToDouble(String, IFormatProvider) Converts the specified string representation of a number to an equivalent double-precision floating-point number, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Boolean) Converts the specified Boolean value to the equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Byte) Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Char) Converts the value of the specified Unicode character to the equivalent 16-bit signed integer.
Public method Static member ToInt16(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Decimal) Converts the value of the specified decimal number to an equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Double) Converts the value of the specified double-precision floating-point number to an equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Int16) Returns the specified 16-bit signed integer; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Int32) Converts the value of the specified 32-bit signed integer to an equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Int64) Converts the value of the specified 64-bit signed integer to an equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Object) Converts the value of the specified object to a 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(SByte) Converts the value of the specified 8-bit signed integer to the equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Single) Converts the value of the specified single-precision floating-point number to an equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(String) Converts the specified string representation of a number to an equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(UInt16) Converts the value of the specified 16-bit unsigned integer to the equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(Object, IFormatProvider) Converts the value of the specified object to a 16-bit signed integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(String, IFormatProvider) Converts the specified string representation of a number to an equivalent 16-bit signed integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt16(String, Int32) Converts the string representation of a number in a specified base to an equivalent 16-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Boolean) Converts the specified Boolean value to the equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Byte) Converts the value of the specified 8-bit unsigned integer to the equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Char) Converts the value of the specified Unicode character to the equivalent 32-bit signed integer.
Public method Static member ToInt32(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Decimal) Converts the value of the specified decimal number to an equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Double) Converts the value of the specified double-precision floating-point number to an equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Int16) Converts the value of the specified 16-bit signed integer to an equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Int32) Returns the specified 32-bit signed integer; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Int64) Converts the value of the specified 64-bit signed integer to an equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Object) Converts the value of the specified object to a 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(SByte) Converts the value of the specified 8-bit signed integer to the equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Single) Converts the value of the specified single-precision floating-point number to an equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(String) Converts the specified string representation of a number to an equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(UInt16) Converts the value of the specified 16-bit unsigned integer to the equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(Object, IFormatProvider) Converts the value of the specified object to a 32-bit signed integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(String, IFormatProvider) Converts the specified string representation of a number to an equivalent 32-bit signed integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt32(String, Int32) Converts the string representation of a number in a specified base to an equivalent 32-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Boolean) Converts the specified Boolean value to the equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Byte) Converts the value of the specified 8-bit unsigned integer to the equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Char) Converts the value of the specified Unicode character to the equivalent 64-bit signed integer.
Public method Static member ToInt64(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Decimal) Converts the value of the specified decimal number to an equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Double) Converts the value of the specified double-precision floating-point number to an equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Int16) Converts the value of the specified 16-bit signed integer to an equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Int32) Converts the value of the specified 32-bit signed integer to an equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Int64) Returns the specified 64-bit signed integer; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Object) Converts the value of the specified object to a 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(SByte) Converts the value of the specified 8-bit signed integer to the equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Single) Converts the value of the specified single-precision floating-point number to an equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(String) Converts the specified string representation of a number to an equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(UInt16) Converts the value of the specified 16-bit unsigned integer to the equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(Object, IFormatProvider) Converts the value of the specified object to a 64-bit signed integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(String, IFormatProvider) Converts the specified string representation of a number to an equivalent 64-bit signed integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToInt64(String, Int32) Converts the string representation of a number in a specified base to an equivalent 64-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Boolean) Converts the specified Boolean value to the equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Byte) Converts the value of the specified 8-bit unsigned integer to the equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Char) Converts the value of the specified Unicode character to the equivalent 8-bit signed integer.
Public method Static member ToSByte(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Decimal) Converts the value of the specified decimal number to an equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Double) Converts the value of the specified double-precision floating-point number to an equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Int16) Converts the value of the specified 16-bit signed integer to the equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Int32) Converts the value of the specified 32-bit signed integer to an equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Int64) Converts the value of the specified 64-bit signed integer to an equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Object) Converts the value of the specified object to an 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(SByte) Returns the specified 8-bit signed integer; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Single) Converts the value of the specified single-precision floating-point number to an equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(String) Converts the specified string representation of a number to an equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(UInt16) Converts the value of the specified 16-bit unsigned integer to the equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(Object, IFormatProvider) Converts the value of the specified object to an 8-bit signed integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(String, IFormatProvider) Converts the specified string representation of a number to an equivalent 8-bit signed integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSByte(String, Int32) Converts the string representation of a number in a specified base to an equivalent 8-bit signed integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Boolean) Converts the specified Boolean value to the equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Byte) Converts the value of the specified 8-bit unsigned integer to the equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Char) Calling this method always throws InvalidCastException.
Public method Static member ToSingle(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Decimal) Converts the value of the specified decimal number to an equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Double) Converts the value of the specified double-precision floating-point number to an equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Int16) Converts the value of the specified 16-bit signed integer to an equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Int32) Converts the value of the specified 32-bit signed integer to an equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Int64) Converts the value of the specified 64-bit signed integer to an equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Object) Converts the value of the specified object to a single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(SByte) Converts the value of the specified 8-bit signed integer to the equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Single) Returns the specified single-precision floating-point number; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(String) Converts the specified string representation of a number to an equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(UInt16) Converts the value of the specified 16-bit unsigned integer to the equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent single-precision floating-point number.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(Object, IFormatProvider) Converts the value of the specified object to an single-precision floating-point number, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToSingle(String, IFormatProvider) Converts the specified string representation of a number to an equivalent single-precision floating-point number, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Boolean) Converts the specified Boolean value to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Byte) Converts the value of the specified 8-bit unsigned integer to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Char) Converts the value of the specified Unicode character to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(DateTime) Converts the value of the specified DateTime to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Decimal) Converts the value of the specified decimal number to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Double) Converts the value of the specified double-precision floating-point number to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Int16) Converts the value of the specified 16-bit signed integer to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Int32) Converts the value of the specified 32-bit signed integer to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Int64) Converts the value of the specified 64-bit signed integer to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Object) Converts the value of the specified object to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(SByte) Converts the value of the specified 8-bit signed integer to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Single) Converts the value of the specified single-precision floating-point number to its equivalent string representation.
Public method Static member ToString(String) Returns the specified string instance; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(UInt16) Converts the value of the specified 16-bit unsigned integer to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(UInt32) Converts the value of the specified 32-bit unsigned integer to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(UInt64) Converts the value of the specified 64-bit unsigned integer to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Boolean, IFormatProvider) Converts the specified Boolean value to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Byte, IFormatProvider) Converts the value of the specified 8-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Byte, Int32) Converts the value of an 8-bit unsigned integer to its equivalent string representation in a specified base.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Char, IFormatProvider) Converts the value of the specified Unicode character to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(DateTime, IFormatProvider) Converts the value of the specified DateTime to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Decimal, IFormatProvider) Converts the value of the specified decimal number to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Double, IFormatProvider) Converts the value of the specified double-precision floating-point number to its equivalent string representation.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Int16, IFormatProvider) Converts the value of the specified 16-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Int16, Int32) Converts the value of a 16-bit signed integer to its equivalent string representation in a specified base.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Int32, IFormatProvider) Converts the value of the specified 32-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Int32, Int32) Converts the value of a 32-bit signed integer to its equivalent string representation in a specified base.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Int64, IFormatProvider) Converts the value of the specified 64-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Int64, Int32) Converts the value of a 64-bit signed integer to its equivalent string representation in a specified base.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Object, IFormatProvider) Converts the value of the specified object to its equivalent string representation using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(SByte, IFormatProvider) Converts the value of the specified 8-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(Single, IFormatProvider) Converts the value of the specified single-precision floating-point number to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member ToString(String, IFormatProvider) Returns the specified string instance; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(UInt16, IFormatProvider) Converts the value of the specified 16-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(UInt32, IFormatProvider) Converts the value of the specified 32-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToString(UInt64, IFormatProvider) Converts the value of the specified 64-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Boolean) Converts the specified Boolean value to the equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Byte) Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Char) Converts the value of the specified Unicode character to the equivalent 16-bit unsigned integer.
Public method Static member ToUInt16(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Decimal) Converts the value of the specified decimal number to an equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Double) Converts the value of the specified double-precision floating-point number to an equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Int16) Converts the value of the specified 16-bit signed integer to the equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Int32) Converts the value of the specified 32-bit signed integer to an equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Int64) Converts the value of the specified 64-bit signed integer to an equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Object) Converts the value of the specified object to a 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(SByte) Converts the value of the specified 8-bit signed integer to the equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Single) Converts the value of the specified single-precision floating-point number to an equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(String) Converts the specified string representation of a number to an equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(UInt16) Returns the specified 16-bit unsigned integer; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(Object, IFormatProvider) Converts the value of the specified object to a 16-bit unsigned integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(String, IFormatProvider) Converts the specified string representation of a number to an equivalent 16-bit unsigned integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt16(String, Int32) Converts the string representation of a number in a specified base to an equivalent 16-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Boolean) Converts the specified Boolean value to the equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Byte) Converts the value of the specified 8-bit unsigned integer to the equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Char) Converts the value of the specified Unicode character to the equivalent 32-bit unsigned integer.
Public method Static member ToUInt32(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Decimal) Converts the value of the specified decimal number to an equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Double) Converts the value of the specified double-precision floating-point number to an equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Int16) Converts the value of the specified 16-bit signed integer to the equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Int32) Converts the value of the specified 32-bit signed integer to an equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Int64) Converts the value of the specified 64-bit signed integer to an equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Object) Converts the value of the specified object to a 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(SByte) Converts the value of the specified 8-bit signed integer to the equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Single) Converts the value of the specified single-precision floating-point number to an equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(String) Converts the specified string representation of a number to an equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(UInt16) Converts the value of the specified 16-bit unsigned integer to the equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(UInt32) Returns the specified 32-bit unsigned integer; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(UInt64) Converts the value of the specified 64-bit unsigned integer to an equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(Object, IFormatProvider) Converts the value of the specified object to a 32-bit unsigned integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(String, IFormatProvider) Converts the specified string representation of a number to an equivalent 32-bit unsigned integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt32(String, Int32) Converts the string representation of a number in a specified base to an equivalent 32-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Boolean) Converts the specified Boolean value to the equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Byte) Converts the value of the specified 8-bit unsigned integer to the equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Char) Converts the value of the specified Unicode character to the equivalent 64-bit unsigned integer.
Public method Static member ToUInt64(DateTime) Calling this method always throws InvalidCastException.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Decimal) Converts the value of the specified decimal number to an equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Double) Converts the value of the specified double-precision floating-point number to an equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Int16) Converts the value of the specified 16-bit signed integer to the equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Int32) Converts the value of the specified 32-bit signed integer to an equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Int64) Converts the value of the specified 64-bit signed integer to an equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Object) Converts the value of the specified object to a 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(SByte) Converts the value of the specified 8-bit signed integer to the equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Single) Converts the value of the specified single-precision floating-point number to an equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(String) Converts the specified string representation of a number to an equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(UInt16) Converts the value of the specified 16-bit unsigned integer to the equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(UInt32) Converts the value of the specified 32-bit unsigned integer to an equivalent 64-bit unsigned integer.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(UInt64) Returns the specified 64-bit unsigned integer; no actual conversion is performed.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(Object, IFormatProvider) Converts the value of the specified object to a 64-bit unsigned integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(String, IFormatProvider) Converts the specified string representation of a number to an equivalent 64-bit unsigned integer, using the specified culture-specific formatting information.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library ToUInt64(String, Int32) Converts the string representation of a number in a specified base to an equivalent 64-bit unsigned integer.
Top
  Name Description
Public field Static member Supported by the XNA Framework Supported by Portable Class Library DBNull A constant that represents a database column that is absent of data; that is, database null.
Top

The static methods of the Convert class are used to support conversion to and from the base data types in the .NET Framework. The supported base types are Boolean, Char, SByte, Byte, Int16, Int32, Int64, UInt16, UInt32, UInt64, Single, Double, Decimal, DateTime and String.

Conversions to and from Base Types

A conversion method exists to convert every base type to every other base type. However, the actual call to a particular conversion method can produce one of five outcomes, depending on the value of the base type at run time and the target base type. These five outcomes are:

  • No conversion. This occurs when an attempt is made to convert from a type to itself (for example, by calling Convert.ToInt32(Int32) with an argument of type Int32). In this case, the method simply returns an instance of the original type.

  • An InvalidCastException. This occurs when a particular conversion is not supported. An InvalidCastException is thrown for the following conversions:

  • A FormatException. This occurs when the attempt to convert a string value to any other base type fails because the string is not in the proper format. The exception is thrown for the following conversions:

    • A string to be converted to a Boolean value does not equal Boolean.TrueString or Boolean.FalseString.

    • A string to be converted to a Char value consists of multiple characters.

    • A string to be converted to any numeric type is not recognized as a valid number.

    • A string to be converted to a DateTime is not recognized as a valid date and time value.

  • A successful conversion. For conversions between two different base types not listed in the previous outcomes, all widening conversions as well as all narrowing conversions that do not result in a loss of data will succeed and the method will return a value of the targeted base type.

  • An OverflowException. This occurs when a narrowing conversion results in a loss of data. For example, trying to convert a Int32 instance whose value is 10000 to a Byte type throws an OverflowException because 10000 is outside the range of the Byte data type.

An exception will not be thrown if the conversion of a numeric type results in a loss of precision (that is, the loss of some least significant digits). However, an exception will be thrown if the result is larger than can be represented by the particular conversion method's return value type.

For example, when a Double is converted to a Single, a loss of precision might occur but no exception is thrown. However, if the magnitude of the Double is too large to be represented by a Single, an overflow exception is thrown.

Conversions from Custom Objects to Base Types

In addition to supporting conversions between the base types, the Convert method supports conversion of any custom type to any base type. To do this, the custom type must implement the IConvertible interface, which defines methods for converting the implementing type to each of the base types. Conversions that are not supported by a particular type should throw an InvalidCastException.

When the ChangeType method is passed a custom type as its first parameter, or when the Convert.ToType method (such as Convert.ToInt32(Object) or Convert.ToDouble(Object, IFormatProvider) is called and passed an instance of a custom type as its first parameter, the Convert method, in turn, calls the custom type's IConvertible implementation to perform the conversion. For more information, see Type Conversion in the .NET Framework.

Culture-Specific Formatting Information

All the base type conversion methods and the ChangeType method include overloads that have a parameter of type IFormatProvider. For example, the Convert.ToBoolean method has the following two overloads:

The IFormatProvider parameter can supply culture-specific formatting information to assist the conversion process. However, it is ignored by most of the base type conversion methods. It is used only by the following base type conversion methods:

However, any user-defined type that implements IConvertible can make use of the IFormatProvider parameter.

Other Conversion Methods

A set of methods support converting an array of bytes to and from a String or to and from an array of Unicode characters consisting of base-64 digit characters. Data expressed as base-64 digits can be easily conveyed over data channels that can only transmit 7-bit characters.

The following example demonstrates some of the conversion methods in the Convert class, including ToInt32, ToBoolean, and ToString.


			double dNumber = 23.15;

			try {
				// Returns 23
				int    iNumber = System.Convert.ToInt32(dNumber);
			}
			catch (System.OverflowException) {
				System.Console.WriteLine(
							"Overflow in double to int conversion.");
			}
			// Returns True
			bool   bNumber = System.Convert.ToBoolean(dNumber);
			
			// Returns "23.15"
			string strNumber = System.Convert.ToString(dNumber);

			try {
				// Returns '2'
				char chrNumber = System.Convert.ToChar(strNumber[0]);
			} 
			catch (System.ArgumentNullException) {
				System.Console.WriteLine("String is null");
			}
			catch (System.FormatException) {
				System.Console.WriteLine("String length is greater than 1.");
			}

			// System.Console.ReadLine() returns a string and it
			// must be converted.
			int newInteger = 0;
			try {
				System.Console.WriteLine("Enter an integer:");
				newInteger = System.Convert.ToInt32(
									System.Console.ReadLine());
			}
			catch (System.ArgumentNullException) {
				System.Console.WriteLine("String is null.");
			}
			catch (System.FormatException) {
				System.Console.WriteLine("String does not consist of an " +
								"optional sign followed by a series of digits.");
			} 
			catch (System.OverflowException) {
				System.Console.WriteLine(
				"Overflow in string to int conversion.");
			}

			System.Console.WriteLine("Your integer as a double is {0}",
									 System.Convert.ToDouble(newInteger));


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Requirements for a generalized Type-conversion strategy in .NET
To better understand the underlying requirements regarding a generalized approach to Type conversion in .NET, please see my answer to a specific, related question at: http://stackoverflow.com/questions/312858/how-can-i-convert-types-at-runtime/7942350#7942350