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 位元不帶正負號的整數,或可以轉換為 1,則傳回該值;否則,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. 所有的轉換由IFormatterConverter與此相關聯SerializationInfoAll conversions are done by the IFormatterConverter associated with this SerializationInfo.

適用於