SerializationInfo.GetChar(String) 方法

定义

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

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

返回

name 关联的 Unicode 字符。The Unicode character associated with name.

异常

namenullname is null.

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 字符,或可以转换为一个 Unicode 字符,则返回该值;否则,会引发 InvalidCastExceptionIf the value is a Unicode character, or can be converted to one, that value is returned; otherwise, a InvalidCastException is thrown. 所有转换都是通过与此 SerializationInfo相关联的 IFormatterConverter 来完成的。All conversions are done by the IFormatterConverter associated with this SerializationInfo.

适用于