SerializationInfo.GetChar(String) SerializationInfo.GetChar(String) SerializationInfo.GetChar(String) SerializationInfo.GetChar(String) Method

定義

SerializationInfo 存放區擷取 Unicode 字元值。Retrieves a Unicode character value from the SerializationInfo store.

public:
 char GetChar(System::String ^ name);
public char GetChar (string name);
member this.GetChar : string -> char
Public Function GetChar (name As String) As Char

參數

name
String String String String

與要擷取的值相關聯的名稱。The name associated with the value to retrieve.

傳回

name 相關聯的 Unicode 字元。The Unicode character associated with name.

例外狀況

name 相關聯的數值無法轉換為 Unicode 字元。The value associated with name cannot be converted to a Unicode character.

在目前的執行個體中找不到具有指定名稱的項目。An element with the specified name is not found in the current instance.

備註

如果值是 Unicode 字元, 或者可以轉換成一個, 則會傳回該值;否則, InvalidCastException就會擲回。If the value is a Unicode character, or can be converted to one, that value is returned; otherwise, a InvalidCastException is thrown. 所有的轉換都是由IFormatterConverter與這個SerializationInfo相關聯的所完成。All conversions are done by the IFormatterConverter associated with this SerializationInfo.

適用於