Share via


SerializationInfo.GetDecimal(String) 方法

定义

SerializationInfo 存储中检索一个十进制值。

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

与要检索的值关联的名称。

返回

SerializationInfo 中的十进制值。

例外

namenull

name 关联的值不能转换为十进制值。

当前实例中没有找到具有指定名称的元素。

注解

如果值为小数,或可转换为小数,则返回该值;否则, InvalidCastException 将引发 。 所有转换都由 IFormatterConverter 与此 SerializationInfo关联的 完成。

适用于