SerializationInfo.GetDecimal(String) SerializationInfo.GetDecimal(String) SerializationInfo.GetDecimal(String) SerializationInfo.GetDecimal(String) Method

定义

SerializationInfo 存储中检索一个十进制值。Retrieves a decimal value from the SerializationInfo store.

public:
 System::Decimal GetDecimal(System::String ^ name);
public decimal GetDecimal (string name);
member this.GetDecimal : string -> decimal
Public Function GetDecimal (name As String) As Decimal

参数

name
String String String String

与要检索的值关联的名称。The name associated with the value to retrieve.

返回

SerializationInfo 中的十进制值。A decimal value from the SerializationInfo.

异常

name 关联的值不能转换为十进制值。The value associated with name cannot be converted to a decimal.

当前实例中没有找到具有指定名称的元素。An element with the specified name is not found in the current instance.

注解

如果值是十进制或可以转换成十进制数字,则返回该值;否则为InvalidCastException引发。If the value is a decimal, or can be converted to a decimal, that value is returned; otherwise, a InvalidCastException is thrown. 所有转换都由IFormatterConverter与此相关SerializationInfoAll conversions are done by the IFormatterConverter associated with this SerializationInfo.

适用于