public sealed class Convert
|
A conversion method exists to convert every base type to every other base type. However, the actual conversion operation performed falls into three categories:
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.
A set of methods support converting an array of bytes to and from a String or 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.
Many of the methods in this class convert a source type to a target type by invoking the corresponding IConvertible explicit interface implementation method on the source object. If such a method does not exist, an InvalidCastException is thrown.
Some of the methods in this class take a parameter object that implements the IFormatProvider interface. This parameter can supply culture-specific formatting information to assist the conversion process. The base value types ignore this parameter, but any user-defined type that implements IConvertible can honor it.
For more information about the base value types, see the appropriate topic listed in the See Also section.
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));
DBNull | A constant representing a database column absent of data; that is, database null. |
ChangeType | Overloaded:ChangeType(object value, Type conversionType) Returns an Object with the specified Type and whose value is equivalent to the specified object. |
ChangeType | Overloaded:ChangeType(object value, TypeCode typeCode) Returns an Object with the specified TypeCode and whose value is equivalent to the specified object. |
ChangeType | Overloaded:ChangeType(object value, Type conversionType, IFormatProvider provider) Returns an Object with the specified Type and whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information. |
ChangeType | Overloaded:ChangeType(object value, TypeCode typeCode, IFormatProvider provider) Returns an Object with the specified TypeCode and whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
FromBase64CharArray | Converts the specified subset of an array of Unicode characters consisting of base 64 digits to an equivalent array of 8-bit unsigned integers. Parameters specify the offset and number of elements in the input array. |
FromBase64String | Converts the specified String representation of a value consisting of base 64 digits to an equivalent array of 8-bit unsigned integers. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
GetTypeCode | Returns the TypeCode for the specified object. |
IsDBNull | Returns an indication whether the specified object is of type TypeCode.DBNull. |
ToBase64CharArray | Converts the value of a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character array consisting of base 64 digits. Parameters specify the subsets as offsets of the input and output arrays and the number of elements in the input array. |
ToBase64String | Overloaded:ToBase64String(byte[] inArray) Converts the value of an array of 8-bit unsigned integers to its equivalent String representation consisting of base 64 digits. |
ToBase64String | Overloaded:ToBase64String(byte[] inArray, int offset, int length) Converts the value of a subset of an array of 8-bit unsigned integers to its equivalent String representation consisting of base 64 digits. Parameters specify the subset as an offset and number of elements in the array. |
ToBoolean | Overloaded:ToBoolean(bool value) Returns the specified Boolean value; no actual conversion is performed. |
ToBoolean | Overloaded:ToBoolean(byte value) Converts the value of the specified 8-bit unsigned integer to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(char value) Calling this method always throws InvalidCastException. |
ToBoolean | Overloaded:ToBoolean(DateTime value) Calling this method always throws InvalidCastException. |
ToBoolean | Overloaded:ToBoolean(decimal value) Converts the value of the specified Decimal number to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(double value) Converts the value of the specified double-precision floating point number to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(short value) Converts the value of the specified 16-bit signed integer to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(int value) Converts the value of the specified 32-bit signed integer to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(long value) Converts the value of the specified 64-bit signed integer to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(object value) Converts the value of a specified Object to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(sbyte value) Converts the value of the specified 8-bit signed integer to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(float value) Converts the value of the specified single-precision floating point number to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(string value) Converts the specified String representation of a logical value to its Boolean equivalent. |
ToBoolean | Overloaded:ToBoolean(ushort value) Converts the value of the specified 16-bit unsigned integer to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent Boolean value. |
ToBoolean | Overloaded:ToBoolean(object value, IFormatProvider provider) Converts the value of the specified Object to an equivalent Boolean value using the specified culture-specific formatting information. |
ToBoolean | Overloaded:ToBoolean(string value, IFormatProvider provider) Converts the specified String representation of a logical value to its Boolean equivalent using the specified culture-specific formatting information. |
ToByte | Overloaded:ToByte(bool value) Converts the value of the specified Boolean value to the equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(byte value) Returns the specified 8-bit unsigned integer; no actual conversion is performed. |
ToByte | Overloaded:ToByte(char value) Converts the value of the specified Unicode character to the equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(DateTime value) Calling this method always throws InvalidCastException. |
ToByte | Overloaded:ToByte(decimal value) Converts the value of the specified Decimal number to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(double value) Converts the value of the specified double-precision floating point number to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(short value) Converts the value of the specified 16-bit signed integer to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(int value) Converts the value of the specified 32-bit signed integer to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(long value) Converts the value of the specified 64-bit signed integer to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(object value) Converts the value of the specified Object to an 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(sbyte value) Converts the value of the specified 8-bit signed integer to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(float value) Converts the value of the specified single-precision floating point number to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(string value) Converts the specified String representation of a number to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(ushort value) Converts the value of the specified 16-bit unsigned integer to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent 8-bit unsigned integer. |
ToByte | Overloaded:ToByte(object value, IFormatProvider provider) Converts the value of the specified Object to an 8-bit unsigned integer using the specified culture-specific formatting information. |
ToByte | Overloaded:ToByte(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent 8-bit signed integer using specified culture-specific formatting information. |
ToByte | Overloaded:ToByte(string value, int fromBase) Converts the String representation of a number in a specified base to an equivalent 8-bit unsigned integer. |
ToChar | Overloaded:ToChar(bool value) Calling this method always throws InvalidCastException. |
ToChar | Overloaded:ToChar(byte value) Converts the value of the specified 8-bit unsigned integer to its equivalent Unicode character. |
ToChar | Overloaded:ToChar(char value) Returns the specified Unicode character value; no actual conversion is performed. |
ToChar | Overloaded:ToChar(DateTime value) Calling this method always throws InvalidCastException. |
ToChar | Overloaded:ToChar(decimal value) Calling this method always throws InvalidCastException. |
ToChar | Overloaded:ToChar(double value) Calling this method always throws InvalidCastException. |
ToChar | Overloaded:ToChar(short value) Converts the value of the specified 16-bit signed integer to its equivalent Unicode character. |
ToChar | Overloaded:ToChar(int value) Converts the value of the specified 32-bit signed integer to its equivalent Unicode character. |
ToChar | Overloaded:ToChar(long value) Converts the value of the specified 64-bit signed integer to its equivalent Unicode character. |
ToChar | Overloaded:ToChar(object value) Converts the value of the specified Object to a Unicode character. |
ToChar | Overloaded:ToChar(sbyte value) Converts the value of the specified 8-bit signed integer to its equivalent Unicode character. |
ToChar | Overloaded:ToChar(float value) Calling this method always throws InvalidCastException. |
ToChar | Overloaded:ToChar(string value) Converts the first character of a String to a Unicode character. |
ToChar | Overloaded:ToChar(ushort value) Converts the value of the specified 16-bit unsigned integer to its equivalent Unicode character. |
ToChar | Overloaded:ToChar(uint value) Converts the value of the specified 32-bit unsigned integer to its equivalent Unicode character. |
ToChar | Overloaded:ToChar(ulong value) Converts the value of the specified 64-bit unsigned integer to its equivalent Unicode character. |
ToChar | Overloaded:ToChar(object value, IFormatProvider provider) Converts the value of the specified Object to its equivalent Unicode character using the specified culture-specific formatting information. |
ToChar | Overloaded:ToChar(string value, IFormatProvider provider) Converts the first character of a String to a Unicode character using specified culture-specific formatting information. |
ToDateTime | Overloaded:ToDateTime(bool value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(byte value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(char value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(DateTime value) Returns the specified DateTime; no actual conversion is performed. |
ToDateTime | Overloaded:ToDateTime(decimal value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(double value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(short value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(int value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(long value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(object value) Converts the value of the specified Object to a DateTime. |
ToDateTime | Overloaded:ToDateTime(sbyte value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(float value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(string value) Converts the specified String representation of a date and time to an equivalent DateTime. |
ToDateTime | Overloaded:ToDateTime(ushort value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(uint value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(ulong value) Calling this method always throws InvalidCastException. |
ToDateTime | Overloaded:ToDateTime(object value, IFormatProvider provider) Converts the value of the specified Object to a DateTime using the specified culture-specific formatting information. |
ToDateTime | Overloaded:ToDateTime(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent DateTime using the specified culture-specific formatting information. |
ToDecimal | Overloaded:ToDecimal(bool value) Converts the value of the specified Boolean value to the equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(byte value) Converts the value of the specified 8-bit unsigned integer to the equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(char value) Calling this method always throws InvalidCastException. |
ToDecimal | Overloaded:ToDecimal(DateTime value) Calling this method always throws InvalidCastException. |
ToDecimal | Overloaded:ToDecimal(decimal value) Returns the specified Decimal number; no actual conversion is performed. |
ToDecimal | Overloaded:ToDecimal(double value) Converts the value of the specified double-precision floating point number to an equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(short value) Converts the value of the specified 16-bit signed integer to an equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(int value) Converts the value of the specified 32-bit signed integer to an equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(long value) Converts the value of the specified 64-bit signed integer to an equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(object value) Converts the value of the specified Object to a Decimal number. |
ToDecimal | Overloaded:ToDecimal(sbyte value) Converts the value of the specified 8-bit signed integer to the equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(float value) Converts the value of the specified single-precision floating point number to the equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(string value) Converts the specified String representation of a number to an equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(ushort value) Converts the value of the specified 16-bit unsigned integer to the equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent Decimal number. |
ToDecimal | Overloaded:ToDecimal(object value, IFormatProvider provider) Converts the value of the specified Object to an Decimal number using the specified culture-specific formatting information. |
ToDecimal | Overloaded:ToDecimal(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent Decimal number using the specified culture-specific formatting information. |
ToDouble | Overloaded:ToDouble(bool value) Converts the value of the specified Boolean value to the equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(byte value) Converts the value of the specified 8-bit unsigned integer to the equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(char value) Calling this method always throws InvalidCastException. |
ToDouble | Overloaded:ToDouble(DateTime value) Calling this method always throws InvalidCastException. |
ToDouble | Overloaded:ToDouble(decimal value) Converts the value of the specified Decimal number to an equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(double value) Returns the specified double-precision floating point number; no actual conversion is performed. |
ToDouble | Overloaded:ToDouble(short value) Converts the value of the specified 16-bit signed integer to an equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(int value) Converts the value of the specified 32-bit signed integer to an equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(long value) Converts the value of the specified 64-bit signed integer to an equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(object value) Converts the value of the specified Object to a double-precision floating point number. |
ToDouble | Overloaded:ToDouble(sbyte value) Converts the value of the specified 8-bit signed integer to the equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(float value) Converts the value of the specified single-precision floating point number to an equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(string value) Converts the specified String representation of a number to an equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(ushort value) Converts the value of the specified 16-bit unsigned integer to the equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent double-precision floating point number. |
ToDouble | Overloaded:ToDouble(object value, IFormatProvider provider) Converts the value of the specified Object to an double-precision floating point number using the specified culture-specific formatting information. |
ToDouble | Overloaded:ToDouble(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent double-precision floating point number using the specified culture-specific formatting information. |
ToInt16 | Overloaded:ToInt16(bool value) Converts the value of the specified Boolean value to the equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(byte value) Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(char value) Converts the value of the specified Unicode character to the equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(DateTime value) Calling this method always throws InvalidCastException. |
ToInt16 | Overloaded:ToInt16(decimal value) Converts the value of the specified Decimal number to an equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(double value) Converts the value of the specified double-precision floating point number to an equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(short value) Returns the specified 16-bit signed integer; no actual conversion is performed. |
ToInt16 | Overloaded:ToInt16(int value) Converts the value of the specified 32-bit signed integer to an equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(long value) Converts the value of the specified 64-bit signed integer to an equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(object value) Converts the value of the specified Object to a 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(sbyte value) Converts the value of the specified 8-bit signed integer to the equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(float value) Converts the value of the specified single-precision floating point number to an equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(string value) Converts the specified String representation of a number to an equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(ushort value) Converts the value of the specified 16-bit unsigned integer to the equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent 16-bit signed integer. |
ToInt16 | Overloaded:ToInt16(object value, IFormatProvider provider) Converts the value of the specified Object to a 16-bit signed integer using the specified culture-specific formatting information. |
ToInt16 | Overloaded:ToInt16(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent 16-bit signed integer using specified culture-specific formatting information. |
ToInt16 | Overloaded:ToInt16(string value, int fromBase) Converts the String representation of a number in a specified base to an equivalent 16-bit signed integer. |
ToInt32 | Overloaded:ToInt32(bool value) Converts the value of the specified Boolean value to the equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(byte value) Converts the value of the specified 8-bit unsigned integer to the equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(char value) Converts the value of the specified Unicode character to the equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(DateTime value) Calling this method always throws InvalidCastException. |
ToInt32 | Overloaded:ToInt32(decimal value) Converts the value of the specified Decimal number to an equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(double value) Converts the value of the specified double-precision floating point number to an equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(short value) Converts the value of the specified 16-bit signed integer to an equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(int value) Returns the specified 32-bit signed integer; no actual conversion is performed. |
ToInt32 | Overloaded:ToInt32(long value) Converts the value of the specified 64-bit signed integer to an equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(object value) Converts the value of the specified Object to a 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(sbyte value) Converts the value of the specified 8-bit signed integer to the equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(float value) Converts the value of the specified single-precision floating point number to an equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(string value) Converts the specified String representation of a number to an equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(ushort value) Converts the value of the specified 16-bit unsigned integer to the equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent 32-bit signed integer. |
ToInt32 | Overloaded:ToInt32(object value, IFormatProvider provider) Converts the value of the specified Object to a 32-bit signed integer using the specified culture-specific formatting information. |
ToInt32 | Overloaded:ToInt32(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent 32-bit signed integer using specified culture-specific formatting information. |
ToInt32 | Overloaded:ToInt32(string value, int fromBase) Converts the String representation of a number in a specified base to an equivalent 32-bit signed integer. |
ToInt64 | Overloaded:ToInt64(bool value) Converts the value of the specified Boolean value to the equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(byte value) Converts the value of the specified 8-bit unsigned integer to the equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(char value) Converts the value of the specified Unicode character to the equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(DateTime value) Calling this method always throws InvalidCastException. |
ToInt64 | Overloaded:ToInt64(decimal value) Converts the value of the specified Decimal number to an equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(double value) Converts the value of the specified double-precision floating point number to an equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(short value) Converts the value of the specified 16-bit signed integer to an equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(int value) Converts the value of the specified 32-bit signed integer to an equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(long value) Returns the specified 64-bit signed integer; no actual conversion is performed. |
ToInt64 | Overloaded:ToInt64(object value) Converts the value of the specified Object to a 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(sbyte value) Converts the value of the specified 8-bit signed integer to the equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(float value) Converts the value of the specified single-precision floating point number to an equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(string value) Converts the specified String representation of a number to an equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(ushort value) Converts the value of the specified 16-bit unsigned integer to the equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent 64-bit signed integer. |
ToInt64 | Overloaded:ToInt64(object value, IFormatProvider provider) Converts the value of the specified Object to a 64-bit signed integer using the specified culture-specific formatting information. |
ToInt64 | Overloaded:ToInt64(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent 64-bit signed integer using the specified culture-specific formatting information. |
ToInt64 | Overloaded:ToInt64(string value, int fromBase) Converts the String representation of a number in a specified base to an equivalent 64-bit signed integer. |
ToSByte | Overloaded:ToSByte(bool value) Converts the value of the specified Boolean value to the equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(byte value) Converts the value of the specified 8-bit unsigned integer to the equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(char value) Converts the value of the specified Unicode character to the equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(DateTime value) Calling this method always throws InvalidCastException. |
ToSByte | Overloaded:ToSByte(decimal value) Converts the value of the specified Decimal number to an equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(double value) Converts the value of the specified double-precision floating point number to an equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(short value) Converts the value of the specified 16-bit signed integer to the equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(int value) Converts the value of the specified 32-bit signed integer to an equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(long value) Converts the value of the specified 64-bit signed integer to an equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(object value) Converts the value of the specified Object to an 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(sbyte value) Returns the specified 8-bit signed integer; no actual conversion is performed. |
ToSByte | Overloaded:ToSByte(float value) Converts the value of the specified single-precision floating point number to an equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(string value) Converts the specified String representation of a number to an equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(ushort value) Converts the value of the specified 16-bit unsigned integer to the equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent 8-bit signed integer. |
ToSByte | Overloaded:ToSByte(object value, IFormatProvider provider) Converts the value of the specified Object to an 8-bit signed integer using the specified culture-specific formatting information. |
ToSByte | Overloaded:ToSByte(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent 8-bit signed integer using specified culture-specific formatting information. |
ToSByte | Overloaded:ToSByte(string value, int fromBase) Converts the String representation of a number in a specified base to an equivalent 8-bit signed integer. |
ToSingle | Overloaded:ToSingle(bool value) Converts the value of the specified Boolean value to the equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(byte value) Converts the value of the specified 8-bit unsigned integer to the equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(char value) Calling this method always throws InvalidCastException. |
ToSingle | Overloaded:ToSingle(DateTime value) Calling this method always throws InvalidCastException. |
ToSingle | Overloaded:ToSingle(decimal value) Converts the value of the specified Decimal number to an equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(double value) Converts the value of the specified double-precision floating point number to an equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(short value) Converts the value of the specified 16-bit signed integer to an equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(int value) Converts the value of the specified 32-bit signed integer to an equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(long value) Converts the value of the specified 64-bit signed integer to an equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(object value) Converts the value of the specified Object to a single-precision floating point number. |
ToSingle | Overloaded:ToSingle(sbyte value) Converts the value of the specified 8-bit signed integer to the equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(float value) Returns the specified single-precision floating point number; no actual conversion is performed. |
ToSingle | Overloaded:ToSingle(string value) Converts the specified String representation of a number to an equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(ushort value) Converts the value of the specified 16-bit unsigned integer to the equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent single-precision floating point number. |
ToSingle | Overloaded:ToSingle(object value, IFormatProvider provider) Converts the value of the specified Object to an single-precision floating point number using the specified culture-specific formatting information. |
ToSingle | Overloaded:ToSingle(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent single-precision floating point number using the specified culture-specific formatting information. |
ToString (inherited from System.Object) |
Overloaded:ToString() See base class member description: System.Object.ToStringDerived from System.Object, the primary base class for all objects. |
ToString | Overloaded:ToString(bool value) Converts the value of the specified Boolean to its equivalent String representation. |
ToString | Overloaded:ToString(byte value) Converts the value of the specified 8-bit unsigned integer to its equivalent String representation. |
ToString | Overloaded:ToString(char value) Converts the value of the specified Unicode character to its equivalent String representation. |
ToString | Overloaded:ToString(DateTime value) Converts the value of the specified DateTime to its equivalent String representation. |
ToString | Overloaded:ToString(decimal value) Converts the value of the specified Decimal number to its equivalent String representation. |
ToString | Overloaded:ToString(double value) Converts the value of the specified double-precision floating point number to its equivalent String representation. |
ToString | Overloaded:ToString(short value) Converts the value of the specified 16-bit signed integer to its equivalent String representation. |
ToString | Overloaded:ToString(int value) Converts the value of the specified 32-bit signed integer to its equivalent String representation. |
ToString | Overloaded:ToString(long value) Converts the value of the specified 64-bit signed integer to its equivalent String representation. |
ToString | Overloaded:ToString(object value) Converts the value of the specified Object to its String representation. |
ToString | Overloaded:ToString(sbyte value) Converts the value of the specified 8-bit signed integer to its equivalent String representation. |
ToString | Overloaded:ToString(float value) Converts the value of the specified single-precision floating point number to its equivalent String representation. |
ToString | Overloaded:ToString(string value) Returns the specified instance of String; no actual conversion is performed. |
ToString | Overloaded:ToString(ushort value) Converts the value of the specified 16-bit unsigned integer to its equivalent String representation. |
ToString | Overloaded:ToString(uint value) Converts the value of the specified 32-bit unsigned integer to its equivalent String representation. |
ToString | Overloaded:ToString(ulong value) Converts the value of the specified 64-bit unsigned integer to its equivalent String representation. |
ToString | Overloaded:ToString(bool value, IFormatProvider provider) Converts the value of the specified Boolean to its equivalent String representation. |
ToString | Overloaded:ToString(byte value, IFormatProvider provider) Converts the value of the specified 8-bit unsigned integer to its equivalent String representation. |
ToString | Overloaded:ToString(byte value, int toBase) Converts the value of an 8-bit unsigned integer to its equivalent String representation in a specified base. |
ToString | Overloaded:ToString(char value, IFormatProvider provider) Converts the value of the specified Unicode character to its equivalent String representation. |
ToString | Overloaded:ToString(DateTime value, IFormatProvider provider) Converts the value of the specified DateTime to its equivalent String representation. |
ToString | Overloaded:ToString(decimal value, IFormatProvider provider) Converts the value of the specified Decimal number to its equivalent String representation. |
ToString | Overloaded:ToString(double value, IFormatProvider provider) Converts the value of the specified double-precision floating point number to its equivalent String representation. |
ToString | Overloaded:ToString(short value, IFormatProvider provider) Converts the value of the specified 16-bit signed integer to its equivalent String representation. |
ToString | Overloaded:ToString(short value, int toBase) Converts the value of a 16-bit signed integer to its equivalent String representation in a specified base. |
ToString | Overloaded:ToString(int value, IFormatProvider provider) Converts the value of the specified 32-bit signed integer to its equivalent String representation. |
ToString | Overloaded:ToString(int value, int toBase) Converts the value of a 32-bit signed integer to its equivalent String representation in a specified base. |
ToString | Overloaded:ToString(long value, IFormatProvider provider) Converts the value of the specified 64-bit signed integer to its equivalent String representation. |
ToString | Overloaded:ToString(long value, int toBase) Converts the value of a 64-bit signed integer to its equivalent String representation in a specified base. |
ToString | Overloaded:ToString(object value, IFormatProvider provider) Converts the value of the specified Object to its equivalent String representation using the specified culture-specific formatting information. |
ToString | Overloaded:ToString(sbyte value, IFormatProvider provider) Converts the value of the specified 8-bit signed integer to its equivalent String representation. |
ToString | Overloaded:ToString(float value, IFormatProvider provider) Converts the value of the specified single-precision floating point number to its equivalent String representation. |
ToString | Overloaded:ToString(string value, IFormatProvider provider) Returns the specified instance of String; no actual conversion is performed. |
ToString | Overloaded:ToString(ushort value, IFormatProvider provider) Converts the value of the specified 16-bit unsigned integer to its equivalent String representation. |
ToString | Overloaded:ToString(uint value, IFormatProvider provider) Converts the value of the specified 32-bit unsigned integer to its equivalent String representation. |
ToString | Overloaded:ToString(ulong value, IFormatProvider provider) Converts the value of the specified 64-bit unsigned integer to its equivalent String representation. |
ToUInt16 | Overloaded:ToUInt16(bool value) Converts the value of the specified Boolean value to the equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(byte value) Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(char value) Converts the value of the specified Unicode character to the equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(DateTime value) Calling this method always throws InvalidCastException. |
ToUInt16 | Overloaded:ToUInt16(decimal value) Converts the value of the specified Decimal number to an equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(double value) Converts the value of the specified double-precision floating point number to an equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(short value) Converts the value of the specified 16-bit signed integer to the equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(int value) Converts the value of the specified 32-bit signed integer to an equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(long value) Converts the value of the specified 64-bit signed integer to an equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(object value) Converts the value of the specified Object to a 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(sbyte value) Converts the value of the specified 8-bit signed integer to the equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(float value) Converts the value of the specified single-precision floating point number to an equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(string value) Converts the specified String representation of a number to an equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(ushort value) Returns the specified 16-bit unsigned integer; no actual conversion is performed. |
ToUInt16 | Overloaded:ToUInt16(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent 16-bit unsigned integer. |
ToUInt16 | Overloaded:ToUInt16(object value, IFormatProvider provider) Converts the value of the specified Object to a 16-bit unsigned integer using the specified culture-specific formatting information. |
ToUInt16 | Overloaded:ToUInt16(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent 16-bit unsigned integer using specified culture-specific formatting information. |
ToUInt16 | Overloaded:ToUInt16(string value, int fromBase) Converts the String representation of a number in a specified base to an equivalent 16-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(bool value) Converts the value of the specified Boolean value to the equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(byte value) Converts the value of the specified 8-bit unsigned integer to the equivalent 32-bit signed integer. |
ToUInt32 | Overloaded:ToUInt32(char value) Converts the value of the specified Unicode character to the equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(DateTime value) Calling this method always throws InvalidCastException. |
ToUInt32 | Overloaded:ToUInt32(decimal value) Converts the value of the specified Decimal number to an equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(double value) Converts the value of the specified double-precision floating point number to an equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(short value) Converts the value of the specified 16-bit signed integer to the equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(int value) Converts the value of the specified 32-bit signed integer to an equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(long value) Converts the value of the specified 64-bit signed integer to an equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(object value) Converts the value of the specified Object to a 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(sbyte value) Converts the value of the specified 8-bit signed integer to the equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(float value) Converts the value of the specified single-precision floating point number to an equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(string value) Converts the specified String representation of a number to an equivalent 32-bit signed integer. |
ToUInt32 | Overloaded:ToUInt32(ushort value) Converts the value of the specified 16-bit unsigned integer to the equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(uint value) Returns the specified 32-bit unsigned integer; no actual conversion is performed. |
ToUInt32 | Overloaded:ToUInt32(ulong value) Converts the value of the specified 64-bit unsigned integer to an equivalent 32-bit unsigned integer. |
ToUInt32 | Overloaded:ToUInt32(object value, IFormatProvider provider) Converts the value of the specified Object to a 32-bit unsigned integer using the specified culture-specific formatting information. |
ToUInt32 | Overloaded:ToUInt32(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent 32-bit unsigned integer using the specified culture-specific formatting information. |
ToUInt32 | Overloaded:ToUInt32(string value, int fromBase) Converts the String representation of a number in a specified base to an equivalent 32-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(bool value) Converts the value of the specified Boolean value to the equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(byte value) Converts the value of the specified 8-bit unsigned integer to the equivalent 64-bit signed integer. |
ToUInt64 | Overloaded:ToUInt64(char value) Converts the value of the specified Unicode character to the equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(DateTime value) Calling this method always throws InvalidCastException. |
ToUInt64 | Overloaded:ToUInt64(decimal value) Converts the value of the specified Decimal number to an equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(double value) Converts the value of the specified double-precision floating point number to an equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(short value) Converts the value of the specified 16-bit signed integer to the equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(int value) Converts the value of the specified 32-bit signed integer to an equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(long value) Converts the value of the specified 64-bit signed integer to an equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(object value) Converts the value of the specified Object to a 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(sbyte value) Converts the value of the specified 8-bit signed integer to the equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(float value) Converts the value of the specified single-precision floating point number to an equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(string value) Converts the specified String representation of a number to an equivalent 64-bit signed integer. |
ToUInt64 | Overloaded:ToUInt64(ushort value) Converts the value of the specified 16-bit unsigned integer to the equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(uint value) Converts the value of the specified 32-bit unsigned integer to an equivalent 64-bit unsigned integer. |
ToUInt64 | Overloaded:ToUInt64(ulong value) Returns the specified 64-bit unsigned integer; no actual conversion is performed. |
ToUInt64 | Overloaded:ToUInt64(object value, IFormatProvider provider) Converts the value of the specified Object to a 64-bit unsigned integer using the specified culture-specific formatting information. |
ToUInt64 | Overloaded:ToUInt64(string value, IFormatProvider provider) Converts the specified String representation of a number to an equivalent 64-bit unsigned integer using the specified culture-specific formatting information. |
ToUInt64 | Overloaded:ToUInt64(string value, int fromBase) Converts the String representation of a number in a specified base to an equivalent 64-bit unsigned integer. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public static readonly object DBNull;
|
value
conversionType
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
typeCode
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
ArgumentException | typeCode is invalid. |
public static object ChangeType( |
value
conversionType
provider
-or-
null, if value and conversionType are nulls.
-or-
value, if the Type of value and conversionType are equal.
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible and conversionType is not null or equal to the Type of value. |
ArgumentException | conversionType is invalid. |
public static object ChangeType( |
value
typeCode
provider
-or-
null if value is null and typeCode is TypeCode.Empty.
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
ArgumentException | typeCode is invalid. |
~Convert(); |
inArray
offset
length
Exception Type | Condition |
---|---|
ArgumentNullException | inArray is null. |
ArgumentOutOfRangeException | offset or length is less than 0. -or- offset plus length indicates a position not within inArray. |
FormatException | The length of inArray is less than 4. -or- The length of inArray is not an even multiple of 4. |
public void DecodeWithCharArray() { System.IO.StreamReader inFile; char[] base64CharArray; try { inFile = new System.IO.StreamReader(inputFileName, System.Text.Encoding.ASCII); base64CharArray = new char[inFile.BaseStream.Length]; inFile.Read(base64CharArray, 0, (int)inFile.BaseStream.Length); inFile.Close(); } catch (System.Exception exp) { // Error creating stream or reading from it. System.Console.WriteLine("{0}", exp.Message); return; } // Convert the Base64 UUEncoded input into binary output. byte[] binaryData; try { binaryData = System.Convert.FromBase64CharArray(base64CharArray, 0, base64CharArray.Length); } catch ( System.ArgumentNullException ) { System.Console.WriteLine("Base 64 character array is null."); return; } catch ( System.FormatException ) { System.Console.WriteLine("Base 64 Char Array length is not " + "4 or is not an even multiple of 4." ); return; } // Write out the decoded data. System.IO.FileStream outFile; try { outFile = new System.IO.FileStream(outputFileName, System.IO.FileMode.Create, System.IO.FileAccess.Write); outFile.Write(binaryData, 0, binaryData.Length); outFile.Close(); } catch (System.Exception exp) { // Error creating stream or writing to it. System.Console.WriteLine("{0}", exp.Message); } }
s
Exception Type | Condition |
---|---|
ArgumentNullException | s is null. |
FormatException | The length of s is less than 4. -or- The length of s is not an even multiple of 4. |
public void DecodeWithString() { System.IO.StreamReader inFile; string base64String; try { char[] base64CharArray; inFile = new System.IO.StreamReader(inputFileName, System.Text.Encoding.ASCII); base64CharArray = new char[inFile.BaseStream.Length]; inFile.Read(base64CharArray, 0, (int)inFile.BaseStream.Length); base64String = new string(base64CharArray); } catch (System.Exception exp) { // Error creating stream or reading from it. System.Console.WriteLine("{0}", exp.Message); return; } // Convert the Base64 UUEncoded input into binary output. byte[] binaryData; try { binaryData = System.Convert.FromBase64String(base64String); } catch (System.ArgumentNullException) { System.Console.WriteLine("Base 64 string is null."); return; } catch (System.FormatException) { System.Console.WriteLine("Base 64 string length is not " + "4 or is not an even multiple of 4." ); return; } // Write out the decoded data. System.IO.FileStream outFile; try { outFile = new System.IO.FileStream(outputFileName, System.IO.FileMode.Create, System.IO.FileAccess.Write); outFile.Write(binaryData, 0, binaryData.Length); outFile.Close(); } catch (System.Exception exp) { // Error creating stream or writing to it. System.Console.WriteLine("{0}", exp.Message); } }
public virtual int GetHashCode(); |
public Type GetType(); |
value
value
protected object MemberwiseClone(); |
public static int ToBase64CharArray( |
inArray
offsetIn
length
outArray
offsetOut
Exception Type | Condition |
---|---|
ArgumentNullException | inArray is null. |
ArgumentOutOfRangeException | offsetIn, offsetOut, or length is negative. -or- offsetIn plus length is greater than the length of inArray. -or- offsetOut plus the number of elements to return is greater than the length of outArray. |
The base 64 digits in ascending order from zero are the uppercase characters 'A' to 'Z', lowercase characters 'a' to 'z', numerals '0' to '9', and the symbols '+' and '/'. The valueless character, '=', is used for trailing padding.
offset and length are 32-bit signed numbers.offsetIn and offsetOut are zero-based array positions.
public void EncodeWithCharArray() { System.IO.FileStream inFile; byte[] binaryData; try { inFile = new System.IO.FileStream(inputFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read); binaryData = new Byte[inFile.Length]; long bytesRead = inFile.Read(binaryData, 0, (int) inFile.Length); inFile.Close(); } catch (System.Exception exp) { // Error creating stream or reading from it. System.Console.WriteLine("{0}", exp.Message); return; } // Convert the binary input into Base64 UUEncoded output. // Each 3 byte sequence in the source data becomes a 4 byte // sequence in the character array. long arrayLength = (long) ((4.0d/3.0d) * binaryData.Length); // If array length is not divisible by 4, go up to the next // multiple of 4. if (arrayLength % 4 != 0) { arrayLength += 4 - arrayLength % 4; } char[] base64CharArray = new char[arrayLength]; try { System.Convert.ToBase64CharArray(binaryData, 0, binaryData.Length, base64CharArray, 0); } catch (System.ArgumentNullException) { System.Console.WriteLine("Binary data array is null."); return; } catch (System.ArgumentOutOfRangeException) { System.Console.WriteLine("Char Array is not large enough."); return; } // Write the UUEncoded version to the output file. System.IO.StreamWriter outFile; try { outFile = new System.IO.StreamWriter(outputFileName, false, System.Text.Encoding.ASCII); outFile.Write(base64CharArray); outFile.Close(); } catch (System.Exception exp) { // Error creating stream or writing to it. System.Console.WriteLine("{0}", exp.Message); } }
inArray
Exception Type | Condition |
---|---|
ArgumentNullException | inArray is null. |
The base 64 digits in ascending order from zero are the uppercase characters 'A' to 'Z', lowercase characters 'a' to 'z', numerals '0' to '9', and the symbols '+' and '/'. The valueless character, '=', is used for trailing padding.
public void EncodeWithString() { System.IO.FileStream inFile; byte[] binaryData; try { inFile = new System.IO.FileStream(inputFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read); binaryData = new Byte[inFile.Length]; long bytesRead = inFile.Read(binaryData, 0, (int)inFile.Length); inFile.Close(); } catch (System.Exception exp) { // Error creating stream or reading from it. System.Console.WriteLine("{0}", exp.Message); return; } // Convert the binary input into Base64 UUEncoded output. string base64String; try { base64String = System.Convert.ToBase64String(binaryData, 0, binaryData.Length); } catch (System.ArgumentNullException) { System.Console.WriteLine("Binary data array is null."); return; } // Write the UUEncoded version to the output file. System.IO.StreamWriter outFile; try { outFile = new System.IO.StreamWriter(outputFileName, false, System.Text.Encoding.ASCII); outFile.Write(base64String); outFile.Close(); } catch (System.Exception exp) { // Error creating stream or writing to it. System.Console.WriteLine("{0}", exp.Message); } }
inArray
offset
length
Exception Type | Condition |
---|---|
ArgumentNullException | inArray is null. |
ArgumentOutOfRangeException | offset or length is negative. -or- offset plus length is greater than the length of inArray. |
The base 64 digits in ascending order from zero are the uppercase characters 'A' to 'Z', lowercase characters 'a' to 'z', numerals '0' to '9', and the symbols '+' and '/'. The valueless character, '=', is used for trailing padding.
offset and length are 32-bit signed numbers.offset is zero-based.
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
value
value
value
value
value
-or-
true or false; the result of invoking the IConvertible.ToBoolean method for the underlying type of value.
value
value
value
Exception Type | Condition |
---|---|
ArgumentNullException | value is a null reference. |
FormatException | value is not equal to Boolean.TrueString or Boolean.FalseString |
value
value
value
public static bool ToBoolean( |
value
provider
-or-
true or false; the result of invoking the ToBoolean method for the underlying type of value.
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement the IConvertible interface. |
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
public static bool ToBoolean( |
value
provider
Exception Type | Condition |
---|---|
ArgumentNullException | value is a null reference. |
FormatException | value is not equal to Boolean.TrueString or Boolean.FalseString |
value
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Byte.MaxValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Byte.MaxValue or less than Byte.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Byte.MaxValue or less than Byte.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than Byte.MinValue or greater than Byte.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than Byte.MinValue or greater than Byte.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than Byte.MinValue or greater than Byte.MaxValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than Byte.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Byte.MaxValue or less than Byte.MinValue. |
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Byte.MinValue or greater than Byte.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Byte.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Byte.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Byte.MaxValue. |
public static byte ToByte( |
value
provider
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
public static byte ToByte( |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Byte.MinValue or greater than Byte.MaxValue. |
value
fromBase
Exception Type | Condition |
---|---|
ArgumentException | fromBase is not 2, 8, 10, or 16. |
OverflowException | value is less than Byte.MinValue or greater than Byte.MaxValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than Char.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than Char.MinValue or greater than Char.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than Char.MinValue or greater than Char.MaxValue. |
value
-or-
Char.MinValue if value equals null.
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement the IConvertible interface. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than Char.MinValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
ArgumentNullException | value is null. |
FormatException | The length of value is not 1. |
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Char.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Char.MaxValue. |
public static char ToChar( |
value
provider
-or-
Char.MinValue if value equals null.
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement the IConvertible interface. |
provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a number, provider could supply culture-specific information about the notation used to represent that number.
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
public static char ToChar( |
value
provider
Exception Type | Condition |
---|---|
ArgumentNullException | value is null. |
FormatException | The length of value is not 1. |
provider is ignored; it does not participate in this operation.
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value is not a properly formatted date and time. |
OverflowException | value represents a number less than DateTime.MinValue or greater than DateTime.MaxValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
public static DateTime ToDateTime( |
value
provider
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a date, provider could supply culture-specific information about the notation used to represent that date.
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
public static DateTime ToDateTime( |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value is not a properly formatted date and time. |
OverflowException | value represents a number less than DateTime.MinValue or greater than DateTime.MaxValue. |
provider is an IFormatProvider instance that obtains a NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is null, the NumberFormatInfo for the current culture is used.
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
value
Exception Type | Condition |
---|---|
OverflowException | The numeric value of value is greater than Decimal.MaxValue or less than Decimal.MinValue. |
value
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
value
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine) and an optional decimal point symbol. |
OverflowException | value represents a number less than Decimal.MinValue or greater than Decimal.MaxValue. |
value
value
value
public static decimal ToDecimal( |
value
provider
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a number, provider could supply culture-specific information about the notation used to represent that number.
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
public static decimal ToDecimal( |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine) and an optional decimal point symbol. |
OverflowException | value represents a number less than Decimal.MinValue or greater than Decimal.MaxValue. |
provider is an IFormatProvider instance that obtains a NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is null, the NumberFormatInfo for the current culture is used.
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
value
value
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
value
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Double.MinValue or greater than Double.MaxValue. |
value
value
value
public static double ToDouble( |
value
provider
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a number, provider could supply culture-specific information about the notation used to represent that number.
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
public static double ToDouble( |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Double.MinValue or greater than Double.MaxValue. |
provider is an IFormatProvider instance that obtains a NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is null, the NumberFormatInfo for the current culture is used.
value
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int16.MaxValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int16.MaxValue or less than Int16.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int16.MaxValue or less than Int16.MinValue. |
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int16.MaxValue or less than Int16.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int16.MaxValue or less than Int16.MinValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int16.MaxValue or less than Int16.MinValue. |
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int16.MinValue or greater than Int16.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int16.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int16.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int16.MaxValue. |
public static short ToInt16( |
value
provider
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
public static short ToInt16( |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int16.MinValue or greater than Int16.MaxValue. |
value
fromBase
Exception Type | Condition |
---|---|
ArgumentException | fromBase is not 2, 8, 10, or 16. |
OverflowException | value is less than Int16.MinValue or greater than Int16.MaxValue. |
value
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int32.MaxValue or less than Int32.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int32.MaxValue or less than Int32.MinValue. |
value
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int32.MaxValue or less than Int32.MinValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int32.MaxValue or less than Int32.MinValue. |
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int32.MinValue or greater than Int32.MaxValue. |
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int32.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int32.MaxValue. |
public static int ToInt32( |
value
provider
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a number, provider could supply culture-specific information about the notation used to represent that number.
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
public static int ToInt32( |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int32.MinValue or greater than Int32.MaxValue. |
provider is an IFormatProvider instance that obtains a NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is null, the NumberFormatInfo for the current culture is used.
value
fromBase
Exception Type | Condition |
---|---|
ArgumentException | fromBase is not 2, 8, 10, or 16. |
value
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int64.MaxValue or less than Int64.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int64.MaxValue or less than Int64.MinValue. |
value
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int64.MaxValue or less than Int64.MinValue. |
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int64.MinValue or greater than Int64.MaxValue. |
value
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than Int64.MaxValue. |
public static long ToInt64( |
value
provider
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a number, provider could supply culture-specific information about the notation used to represent that number.
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
public static long ToInt64( |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int64.MinValue or greater than Int64.MaxValue. |
provider is an IFormatProvider instance that obtains a NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is null, the NumberFormatInfo for the current culture is used.
value
fromBase
Exception Type | Condition |
---|---|
ArgumentException | fromBase is not 2, 8, 10, or 16. |
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue or less than SByte.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue or less than SByte.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue or less than SByte.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue or less than SByte.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue or less than SByte.MinValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue or less than SByte.MinValue. |
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than SByte.MinValue or greater than SByte.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue or less than SByte.MinValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than SByte.MaxValue or less than SByte.MinValue. |
[CLSCompliant(false)] |
value
provider
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
[CLSCompliant(false)] |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than SByte.MinValue or greater than SByte.MaxValue. |
value
fromBase
Exception Type | Condition |
---|---|
ArgumentException | fromBase is not 2, 8, 10, or 16. |
OverflowException | value is less than SByte.MinValue or greater than SByte.MaxValue. |
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
value is rounded using rounding to nearest. For example, when rounded to two decimals, the value 2.345 becomes 2.34 and the value 2.355 becomes 2.36.
value
value
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
value
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Single.MinValue or greater than Single.MaxValue. |
value
value
value
public static float ToSingle( |
value
provider
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a number, provider could supply culture-specific information about the notation used to represent that number.
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
public static float ToSingle( |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Single.MinValue or greater than Single.MaxValue. |
provider is an IFormatProvider instance that obtains a NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is null, the NumberFormatInfo for the current culture is used.
public virtual string ToString(); |
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
public static string ToString( |
value
provider
public static string ToString( |
value
provider
value
toBase
Exception Type | Condition |
---|---|
ArgumentException | toBase is not 2, 8, 10, or 16. |
public static string ToString( |
value
provider
public static string ToString( |
value
provider
public static string ToString( |
value
provider
public static string ToString( |
value
provider
provider is ignored; it does not participate in this operation.
public static string ToString( |
value
provider
value
toBase
Exception Type | Condition |
---|---|
ArgumentException | toBase is not 2, 8, 10, or 16. |
public static string ToString( |
value
provider
value
toBase
Exception Type | Condition |
---|---|
ArgumentException | toBase is not 2, 8, 10, or 16. |
public static string ToString( |
value
provider
value
toBase
Exception Type | Condition |
---|---|
ArgumentException | toBase is not 2, 8, 10, or 16. |
public static string ToString( |
value
provider
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
The return value is the result of invoking the IConvertible.ToString method of the underlying type of value if the underlying type implements the IConvertible interface; otherwise, the return value is the result of invoking the ToString method of the underlying type.
[CLSCompliant(false)] |
value
provider
public static string ToString( |
value
provider
public static string ToString( |
value
provider
[CLSCompliant(false)] |
value
provider
[CLSCompliant(false)] |
value
provider
[CLSCompliant(false)] |
value
provider
value
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt16.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt16.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt16.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt16.MaxValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt16.MaxValue. |
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int16.MinValue or greater than Int16.MaxValue. |
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than UInt16.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than UInt16.MaxValue. |
[CLSCompliant(false)] |
value
provider
provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a number, provider could supply culture-specific information about the notation used to represent that number.
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
[CLSCompliant(false)] |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int16.MinValue or greater than Int16.MaxValue. |
provider is an IFormatProvider instance that obtains a NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is null, the NumberFormatInfo for the current culture is used.
value
fromBase
Exception Type | Condition |
---|---|
ArgumentException | fromBase is not 2, 8, 10, or 16. |
OverflowException | value is less than UInt16.MinValue or greater than UInt16.MaxValue. |
value
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt32.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt32.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt32.MaxValue. |
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt32.MaxValue. |
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int32.MinValue or greater than Int32.MaxValue. |
value
value
value
Exception Type | Condition |
---|---|
OverflowException | value is greater than UInt32.MaxValue. |
[CLSCompliant(false)] |
value
provider
provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a number, provider could supply culture-specific information about the notation used to represent that number.
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
[CLSCompliant(false)] |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int32.MinValue or greater than Int32.MaxValue. |
provider is an IFormatProvider instance that obtains a NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is null, the NumberFormatInfo for the current culture is used.
value
fromBase
Exception Type | Condition |
---|---|
ArgumentException | fromBase is not 2, 8, 10, or 16. |
value
value
value
value
Exception Type | Condition |
---|---|
InvalidCastException | This conversion is not supported. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt64.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt64.MaxValue. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero. |
value
Exception Type | Condition |
---|---|
InvalidCastException | value does not implement IConvertible. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero. |
value
Exception Type | Condition |
---|---|
OverflowException | value is less than zero or greater than UInt64.MaxValue. |
value
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int64.MinValue or greater than Int64.MaxValue. |
value
value
value
[CLSCompliant(false)] |
value
provider
provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a number, provider could supply culture-specific information about the notation used to represent that number.
The base types ignore provider; however, it is honored if value is a user-defined type that implements the IConvertible interface.
[CLSCompliant(false)] |
value
provider
Exception Type | Condition |
---|---|
ArgumentException | value is null. |
FormatException | value does not consist of an optional sign followed by a sequence of digits (zero through nine). |
OverflowException | value represents a number less than Int64.MinValue or greater than Int64.MaxValue. |
provider is an IFormatProvider instance that obtains a NumberFormatInfo object. The NumberFormatInfo object provides culture-specific information about the format of value. If provider is null, the NumberFormatInfo for the current culture is used.
value
fromBase
Exception Type | Condition |
---|---|
ArgumentException | fromBase is not 2, 8, 10, or 16. |