SerializationInfo.GetDecimal(String) SerializationInfo.GetDecimal(String) SerializationInfo.GetDecimal(String) SerializationInfo.GetDecimal(String) Method

定義

SerializationInfo 存放區擷取十進位值。Retrieves a decimal value from the SerializationInfo store.

public:
 System::Decimal GetDecimal(System::String ^ name);
public decimal GetDecimal (string name);
member this.GetDecimal : string -> decimal
Public Function GetDecimal (name As String) As Decimal

參數

name
String String String String

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

傳回

SerializationInfo 的十進位值。A decimal value from the SerializationInfo.

例外狀況

name 相關聯的值無法轉換為十進位。The value associated with name cannot be converted to a decimal.

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

備註

如果值是十進位數,或可以轉換成小數,則傳回該值;否則,InvalidCastException就會擲回。If the value is a decimal, or can be converted to a decimal, that value is returned; otherwise, a InvalidCastException is thrown. 所有的轉換由IFormatterConverter與此相關聯SerializationInfoAll conversions are done by the IFormatterConverter associated with this SerializationInfo.

適用於