SerializationInfo.GetUInt16(String) 方法

定义

重要

此 API 不符合 CLS。

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

public:
 System::UInt16 GetUInt16(System::String ^ name);
[System.CLSCompliant(false)]
public ushort GetUInt16 (string name);
[<System.CLSCompliant(false)>]
member this.GetUInt16 : string -> uint16
Public Function GetUInt16 (name As String) As UShort

参数

name
String

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

返回

UInt16

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

属性

例外

namenull

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

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

注解

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

适用于