SerializationInfo.GetInt64(String) 方法

定義

SerializationInfo 存放區擷取 64 位元帶正負號的整數值。Retrieves a 64-bit signed integer value from the SerializationInfo store.

public:
 long GetInt64(System::String ^ name);
public long GetInt64 (string name);
member this.GetInt64 : string -> int64
Public Function GetInt64 (name As String) As Long

參數

name
String

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

傳回

name 建立關聯的 64 位元帶正負號的整數。The 64-bit signed integer associated with name.

例外狀況

namenullname is null.

name 建立關聯的值無法轉換為 64 位元帶正負號的整數。The value associated with name cannot be converted to a 64-bit signed integer.

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

備註

如果值是64位帶正負號的整數, 或可以轉換成一個, 則會傳回該值;否則, InvalidCastException就會擲回。If the value is a 64-bit signed integer, or can be converted to one, that value is returned; otherwise, a InvalidCastException is thrown. 所有的轉換都是由IFormatterConverter與這個SerializationInfo相關聯的所完成。All conversions are done by the IFormatterConverter associated with this SerializationInfo.

適用於