SerializationInfo.GetDouble(String) 方法

定义

SerializationInfo 存储中检索一个双精度浮点值。Retrieves a double-precision floating-point value from the SerializationInfo store.

public:
 double GetDouble(System::String ^ name);
public double GetDouble (string name);
member this.GetDouble : string -> double
Public Function GetDouble (name As String) As Double

参数

name
String

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

返回

name 关联的双精度浮点值。The double-precision floating-point value associated with name.

异常

namenullname is null.

name 关联的值不能转换为双精度浮点值。The value associated with name cannot be converted to a double-precision floating-point value.

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

注解

如果该值为 double, 或可转换为 double, 则返回该值;否则, InvalidCastException将引发。If the value is a double, or can be converted to a double, that value is returned; otherwise, a InvalidCastException is thrown. 所有转换都是通过与IFormatterConverterSerializationInfo关联的来完成的。All conversions are done by the IFormatterConverter associated with this SerializationInfo.

适用于