語言

SerializationInfo.GetUInt16(String) 方法

定義

重要

此 API 不符合 CLS 規範。

從儲存庫取得一個 16 位元的無符號整數值 SerializationInfo 。

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

與要取回的值相關聯的名稱。

傳回

與 name相關聯的 16 位元無符號整數。

屬性

例外狀況

name 是 null。

所關聯的 name 值無法轉換為 16 位元無符號整數。

目前實例中找不到指定名稱的元素。

備註

若值為 16 位元無號整數,或可轉換為 1,則回傳該值;否則,擲出 a InvalidCastException 。 所有轉換皆由 IFormatterConverter 與此 SerializationInfo相關的 進行。

適用於