SerializationInfo.GetByte(String) 方法

定义

SerializationInfo 存储中检索一个 8 位无符号整数值。

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

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

返回

name 关联的 8 位无符号整数。

例外

namenull

name 关联的值不能转换为 8 位无符号整数。

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

注解

如果值是 8 位无符号整数,或者可以转换为 1,则返回该值;否则, InvalidCastException 将引发 。 所有转换都由 IFormatterConverter 与此 SerializationInfo关联的 完成。

适用于