SerializationInfo.GetSingle(String) SerializationInfo.GetSingle(String) SerializationInfo.GetSingle(String) SerializationInfo.GetSingle(String) Method

定义

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

public:
 float GetSingle(System::String ^ name);
public float GetSingle (string name);
member this.GetSingle : string -> single
Public Function GetSingle (name As String) As Single

参数

name
String String String String

要检索的值的名称。The name of the value to retrieve.

返回

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

异常

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

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

注解

如果值是一个单精度浮点数,或可以转换为一个,则返回该值;否则为InvalidCastException引发。If the value is a single-precision floating-point number, or can be converted to one, that value is returned; otherwise, a InvalidCastException is thrown. 所有转换都由IFormatterConverter与此相关SerializationInfoAll conversions are done by the IFormatterConverter associated with this SerializationInfo.

适用于