SerializationInfo.GetBoolean(String) SerializationInfo.GetBoolean(String) SerializationInfo.GetBoolean(String) SerializationInfo.GetBoolean(String) Method

定义

SerializationInfo 存储中检索一个布尔值。Retrieves a Boolean value from the SerializationInfo store.

public:
 bool GetBoolean(System::String ^ name);
public bool GetBoolean (string name);
member this.GetBoolean : string -> bool
Public Function GetBoolean (name As String) As Boolean

参数

name
String String String String

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

返回

name 关联的布尔值。The Boolean value associated with name.

异常

name 关联的值不能转换为布尔值。The value associated with name cannot be converted to a Boolean value.

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

注解

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

适用于