SerializationInfo.GetByte(String) SerializationInfo.GetByte(String) SerializationInfo.GetByte(String) SerializationInfo.GetByte(String) Method

定义

SerializationInfo 存储中检索一个 8 位无符号整数值。Retrieves an 8-bit unsigned integer value from the SerializationInfo store.

public:
 System::Byte GetByte(System::String ^ name);
public byte GetByte (string name);
member this.GetByte : string -> byte
Public Function GetByte (name As String) As Byte

参数

name
String String String String

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

返回

name 关联的 8 位无符号整数。The 8-bit unsigned integer associated with name.

异常

name 关联的值不能转换为 8 位无符号整数。The value associated with name cannot be converted to an 8-bit unsigned integer.

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

注解

如果值是一个8位无符号整数, 或可以转换为一个值, 则返回该值;否则, InvalidCastException将引发。If the value is an 8-bit unsigned integer, 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.

适用于