SerializationInfo.GetUInt16(String) SerializationInfo.GetUInt16(String) SerializationInfo.GetUInt16(String) SerializationInfo.GetUInt16(String) Method

定义

重要

此 API 不符合 CLS。

SerializationInfo 存储中检索一个 16 位无符号整数值。Retrieves a 16-bit unsigned integer value from the SerializationInfo store.

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

参数

name
String String String String

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

返回

name 关联的 16 位无符号整数。The 16-bit unsigned integer associated with name.

异常

name 关联的值不能转换为 16 位无符号整数。The value associated with name cannot be converted to a 16-bit unsigned integer.

当前实例中没有找到具有指定名称的元素。An element with the specified name is not found in the current instance.

注解

如果值是一个 16 位无符号的整数,或可以转换为一个,则返回该值;否则为InvalidCastException引发。If the value is a 16-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.

适用于